agent

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: MPL-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const ContainerActivityFile = "/tmp/devpod.activity"
View Source
const ContainerDevPodHelperLocation = "/usr/local/bin/devpod"
View Source
const DefaultInactivityTimeout = time.Minute * 20
View Source
const RemoteDevPodHelperLocation = "/tmp/devpod"
View Source
const WorkspaceDevContainerResult = "result.json"

Variables

View Source
var ErrFindAgentHomeFolder = fmt.Errorf("couldn't find devpod home directory")

Functions

func CreateAgentWorkspaceDir

func CreateAgentWorkspaceDir(agentFolder, context, workspaceID string) (string, error)

func DecodeWorkspaceInfo

func DecodeWorkspaceInfo(workspaceInfoRaw string) (*provider2.AgentWorkspaceInfo, string, error)

func DefaultAgentDownloadURL

func DefaultAgentDownloadURL() string

func FindAgentHomeFolder

func FindAgentHomeFolder(agentFolder string) (string, error)

func GetAgentBinariesDir

func GetAgentBinariesDir(agentFolder, context, workspaceID string) (string, error)

func GetAgentDaemonLogFolder

func GetAgentDaemonLogFolder(agentFolder string) (string, error)

func GetAgentWorkspaceContentDir

func GetAgentWorkspaceContentDir(workspaceDir string) string

func GetAgentWorkspaceDir

func GetAgentWorkspaceDir(agentFolder, context, workspaceID string) (string, error)

func InjectAgent

func InjectAgent(ctx context.Context, exec inject.ExecFunc, remoteAgentPath, downloadURL string, preferDownload bool, log log.Logger) error

func InjectAgentAndExecute

func InjectAgentAndExecute(ctx context.Context, exec inject.ExecFunc, remoteAgentPath, downloadURL string, preferDownload bool, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer, log log.Logger) error

func NewStreamReader

func NewStreamReader(stream tunnel.Tunnel_ReadWorkspaceClient) io.Reader

func NewStreamWriter

func NewStreamWriter(stream tunnel.Tunnel_ReadWorkspaceServer, log log.Logger) io.Writer

func NewTunnelClient

func NewTunnelClient(reader io.Reader, writer io.WriteCloser, exitOnClose bool) (tunnel.TunnelClient, error)

func NewTunnelLogger

func NewTunnelLogger(ctx context.Context, client tunnel.TunnelClient, debug bool) log.Logger

func PrepareAgentHomeFolder

func PrepareAgentHomeFolder(agentFolder string) (string, error)

func ReadAgentWorkspaceDevContainerResult

func ReadAgentWorkspaceDevContainerResult(agentFolder, context, id string) (*config.Result, error)

func ReadAgentWorkspaceInfo

func ReadAgentWorkspaceInfo(agentFolder, context, id string, log log.Logger) (bool, *provider2.AgentWorkspaceInfo, error)

func RunTunnelServer

func RunTunnelServer(ctx context.Context, reader io.Reader, writer io.WriteCloser, exitOnClose, allowGitCredentials, allowDockerCredentials bool, workspace *provider2.Workspace, forwarder netstat.Forwarder, log log.Logger) (*config.Result, error)

func Tunnel

func Tunnel(
	ctx context.Context,
	driver driver.Driver,
	containerID string,
	token string,
	user string,
	stdin io.Reader,
	stdout io.Writer,
	stderr io.Writer,
	trackActivity bool,
	log log.Logger,
) error

func WriteAgentWorkspaceDevContainerResult

func WriteAgentWorkspaceDevContainerResult(agentFolder, context, id string, result *config.Result) error

func WriteWorkspaceInfo

func WriteWorkspaceInfo(workspaceInfoEncoded string, log log.Logger) (bool, *provider2.AgentWorkspaceInfo, error)

func WriteWorkspaceInfoAndDeleteOld

func WriteWorkspaceInfoAndDeleteOld(workspaceInfoEncoded string, deleteWorkspace func(workspaceInfo *provider2.AgentWorkspaceInfo, log log.Logger) error, log log.Logger) (bool, *provider2.AgentWorkspaceInfo, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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