agent

package
v0.3.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: MPL-2.0 Imports: 24 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,
	local bool,
	remoteAgentPath,
	downloadURL string,
	preferDownload bool,
	log log.Logger,
) error

func InjectAgentAndExecute

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

func PrepareAgentHomeFolder

func PrepareAgentHomeFolder(agentFolder string) (string, error)

func ReadAgentWorkspaceInfo

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

func Tunnel

func Tunnel(
	ctx context.Context,
	exec Exec,
	user string,
	stdin io.Reader,
	stdout io.Writer,
	stderr io.Writer,
	log log.Logger,
) 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

type Exec added in v0.2.0

type Exec func(ctx context.Context, user string, command string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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