agentconfig

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultImage      = "ghcr.io/sethcurry/abyss-pi:latest"
	DefaultServerPort = 8080

	DefaultTLSServerCertPath      = "/etc/abyss/tls/server.crt"
	DefaultTLSServerKeyPath       = "/etc/abyss/tls/server.key"
	DefaultTLSCACertPath          = "/etc/abyss/tls/ca.crt"
	DefaultStartFilePath          = "/tmp/abyss.start"
	WaitForStartFileSleepDuration = time.Second
)

Variables

This section is empty.

Functions

func BuildAgentProxyArgs added in v0.0.2

func BuildAgentProxyArgs(cfg *AgentConfig) string

Types

type ACPConfig

type ACPConfig struct {
	ToolsOnHost ToolsOnHostConfig `yaml:"tools_on_host"`
}

func (ACPConfig) Validate added in v0.0.2

func (a ACPConfig) Validate() error

Validate implements types.Validator by validating the nested tools-on-host config.

type AgentConfig

type AgentConfig struct {
	Docker       DockerConfig         `yaml:"docker"`
	SetupScripts []SetupScriptsConfig `yaml:"setup_scripts"`
	CopyFiles    []FileCopyConfig     `yaml:"copy_files"`
	ACP          ACPConfig            `yaml:"acp"`
	Websocket    WebsocketConfig      `yaml:"websocket"`
}

func FromYAMLFile

func FromYAMLFile(path string) (*AgentConfig, error)

FromYAMLFile reads the YAML file at the given path and unmarshals it into an *AgentConfig.

func (AgentConfig) Validate added in v0.0.2

func (a AgentConfig) Validate() error

Validate implements types.Validator by validating each nested config.

type DockerConfig

type DockerConfig struct {
	// The Docker image to use.  Can be short or long, Docker will
	// resolve it for short names.
	Image           string          `yaml:"image"`
	ImagePullPolicy ImagePullPolicy `yaml:"image_pull_policy"`
	HostMounts      []HostMount     `yaml:"host_mounts"`
	AgentCommand    []string        `yaml:"agent_command"`
}

func (DockerConfig) Validate added in v0.0.2

func (d DockerConfig) Validate() error

Validate implements types.Validator by checking the image and each host mount.

type FileCopyConfig

type FileCopyConfig struct {
	// Type is currently either "inline" or "path"
	Type FileCopyType `yaml:"type"`
	// Source is the content or file path of the source
	Source string `yaml:"source"`
	// Target is the destination path on the agent
	Target string `yaml:"target"`
}

func (FileCopyConfig) Validate added in v0.0.2

func (f FileCopyConfig) Validate() error

Validate implements types.Validator by checking the source, target, and type.

type FileCopyType

type FileCopyType string

FileCopyType is an enum type. It exists solely so UnmarshalYAML can validate the type field.

const (
	FileCopyTypeInline FileCopyType = "inline"
	FileCopyTypePath   FileCopyType = "path"
)

func (*FileCopyType) UnmarshalYAML

func (t *FileCopyType) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML validates that the Type field is either "inline" or "path".

type HostMount

type HostMount struct {
	Source      string `yaml:"source"`
	Destination string `yaml:"destination"`
}

func (HostMount) Validate added in v0.0.2

func (h HostMount) Validate() error

type ImagePullPolicy added in v0.0.2

type ImagePullPolicy string

ImagePullPolicy controls when Docker pulls the configured image.

const (
	ImagePullPolicyAlways       ImagePullPolicy = "Always"
	ImagePullPolicyIfNotPresent ImagePullPolicy = "IfNotPresent"
	ImagePullPolicyNever        ImagePullPolicy = "Never"
)

func (ImagePullPolicy) Validate added in v0.0.2

func (p ImagePullPolicy) Validate() error

Validate implements types.Validator by rejecting values outside the allowed set. An empty value is treated as unset and is valid.

type SetupScriptType

type SetupScriptType string

SetupScriptType is an enum type. It exists solely so UnmarshalYAML can validate the type field.

const (
	SetupScriptTypeFile   SetupScriptType = "file"
	SetupScriptTypeInline SetupScriptType = "inline"
)

func (*SetupScriptType) UnmarshalYAML

func (t *SetupScriptType) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML validates that the Type field is either "file" or "inline".

type SetupScriptsConfig

type SetupScriptsConfig struct {
	// Type is either "inline" or "file"
	Type SetupScriptType `yaml:"type"`
	// Source is the script content or file path
	Source string `yaml:"source"`
}

func (SetupScriptsConfig) Validate added in v0.0.2

func (s SetupScriptsConfig) Validate() error

Validate implements types.Validator by checking the source and type. An empty type is allowed and treated as inline.

type ToolsOnHostConfig

type ToolsOnHostConfig struct {
	Files    bool `yaml:"files"`
	Terminal bool `yaml:"terminal"`
}

func (ToolsOnHostConfig) Validate added in v0.0.2

func (t ToolsOnHostConfig) Validate() error

Validate implements types.Validator. There is nothing to validate for boolean flags.

type WebsocketConfig added in v0.0.2

type WebsocketConfig struct {
	DisableTLS bool `yaml:"disable_tls"`
}

Jump to

Keyboard shortcuts

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