lobby

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package lobby defines the Lobby object to hold a bunch of common objects for reuse

Index

Constants

This section is empty.

Variables

View Source
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

View Source
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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL