agent

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAgentId added in v1.7.0

func WithAgentId(agentId string) func(agent *Agent)

func WithDriver added in v1.10.0

func WithDriver(drv driver.Driver) func(agent *Agent)

func WithGrpc added in v1.7.0

func WithGrpc(grpcUrl string, creds clientcredentials.Config) func(agent *Agent)

TODO: This should be updated to accept clientcredentials.Config to support rotation of expired tokens. For now, we will accept failure

func WithHttpClient added in v1.7.0

func WithHttpClient(client *http.Client) func(agent *Agent)

func WithLogger added in v1.7.0

func WithLogger(logger *zap.Logger) func(agent *Agent)

func WithOrganizationId added in v1.7.0

func WithOrganizationId(organizationId string) func(agent *Agent)

func WithRunnerImage added in v1.7.0

func WithRunnerImage(runnerImage string, pullPolicy string) func(agent *Agent)

Types

type Agent

type Agent struct {
	// contains filtered or unexported fields
}

func New

func New(options ...func(*Agent)) *Agent

func (*Agent) Run

func (a *Agent) Run() error

For now, this just queries the current list of runs, and exits. However, it should query the API (or stream) and emit runners as needed

type AuthInterceptor added in v1.10.0

type AuthInterceptor struct {
	// contains filtered or unexported fields
}

func NewAuthInterceptor added in v1.10.0

func NewAuthInterceptor(
	credentials clientcredentials.Config,
) *AuthInterceptor

func (*AuthInterceptor) WrapStreamingClient added in v1.10.0

func (*AuthInterceptor) WrapStreamingHandler added in v1.10.0

func (*AuthInterceptor) WrapUnary added in v1.10.0

func (i *AuthInterceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc

type ChangeSink

type ChangeSink struct {
	Sdk   *sdk.Sdk
	RunId string
}

func (ChangeSink) Write

func (sink ChangeSink) Write(p []byte) (int, error)

type ChangeSummary

type ChangeSummary struct {
	Type    string              `json:"type"`
	Changes ChangeSummaryChange `json:"changes"`
}

type ChangeSummaryChange

type ChangeSummaryChange struct {
	Add       int    `json:"add"`
	Change    int    `json:"change"`
	Remove    int    `json:"remove"`
	Import    int    `json:"import"`
	Operation string `json:"operation"`
}

type Config

type Config struct {
	Runner  *RunnerConfig `yaml:"runner,omitempty"`
	AgentId string        `yaml:"agentId"`
}

func LoadConfig

func LoadConfig() (*Config, error)

func (*Config) GetAgentId

func (c *Config) GetAgentId() string

func (*Config) GetImage

func (c *Config) GetImage() string

func (*Config) GetNamespace

func (c *Config) GetNamespace() string

type RunnerConfig

type RunnerConfig struct {
	Image     string `yaml:"image,omitempty"`
	Version   string `yaml:"version,omitempty"`
	Namespace string `yaml:"namespace,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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