Documentation
¶
Overview ¶
Package lobby defines the Lobby object to hold a bunch of common objects for reuse
Index ¶
- Variables
- func FormatCommandBasedOnSudo(sudo bool, sudoPassword string, Env entity.EnvList, command string, ...) string
- func InjectNamespacesAndEnvs(task entity.Task, Env entity.EnvList, c entity.ClientFacade) entity.EnvList
- func SetupAuthMethods(authMethods []ssh.AuthMethod, host entity.NetworkHost) []ssh.AuthMethod
- type ServiceLobby
Constants ¶
This section is empty.
Variables ¶
var RegisterCmdBash = `` /* 593-byte string literal not displayed */
RegisterCmd is the shell function literal to register a key and value in a file later to be parsed by ssup for any envs passed inside moved here to reduce code duplication
var RegisterCmdDisabled = ""
Functions ¶
func FormatCommandBasedOnSudo ¶
func FormatCommandBasedOnSudo(sudo bool, sudoPassword string, Env entity.EnvList, command string, c entity.ClientFacade, task entity.Task, isLocal bool) string
FormatCommandBasedOnSudo returns the command to be executed
`register` bash function is injected here, injected only for non sudo invocations if sudo is set to true, the command will be wrapped into script and and remote command will just execute that script
which means we have to inject the command into a script for sudo invocation too and that happens to hapen inside func (c *SSHClient) GenerateOnRemote(data []byte) error which shares the same code defined in lobby.RegisterCmd
func InjectNamespacesAndEnvs ¶
func InjectNamespacesAndEnvs(task entity.Task, Env entity.EnvList, c entity.ClientFacade) entity.EnvList
InjectNamespacesAndEnvs injects the namespaces and envs into the command
namespaces follow command definitions to overwrite envs with values returned from namespaces
func SetupAuthMethods ¶
func SetupAuthMethods(authMethods []ssh.AuthMethod, host entity.NetworkHost) []ssh.AuthMethod
SetupAuthMethods returns the authentication methods to use when connecting to a remote server
Types ¶
type ServiceLobby ¶
type ServiceLobby struct {
KeyAuth *ssh.AuthMethod
Namespaces *namespace.Namespace
}
ServiceLobby holds common serices used by many places in code
var ServiceRegistry *ServiceLobby
ServiceRegistry holds common serices used by many places in code