agent

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	Client *kubernetes.Clientset
	Config *Config
	Sdk    *sdk.Sdk
	// contains filtered or unexported fields
}

func New

func New(client *kubernetes.Clientset, sdk *sdk.Sdk, conf *Config) (*Agent, error)

func (*Agent) PollLogs

func (a *Agent) PollLogs(closer io.ReadCloser) error

func (*Agent) RegisterSink

func (a *Agent) RegisterSink(sink io.Writer)

func (*Agent) Run

func (a *Agent) Run() error

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

func (*Agent) Write

func (a *Agent) Write(p []byte) (int, error)

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"`
	Server  *ServerConfig `yaml:"server,omitempty"`
	AgentId string        `yaml:"agentId"`
}

func LoadConfig

func LoadConfig() (*Config, error)

func (*Config) GetAgentId

func (c *Config) GetAgentId() string

func (*Config) GetApiUrl

func (c *Config) GetApiUrl() 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"`
}

type ServerConfig

type ServerConfig struct {
	ApiUrl   string `yaml:"apiUrl,omitempty"`
	TokenUrl string `yaml:"tokenUrl,omitempty"`
}

Jump to

Keyboard shortcuts

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