agent

package
v0.0.0-...-ba26d65 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const HeartbeatInterval = 5 * time.Second

Variables

This section is empty.

Functions

func GetAgentID

func GetAgentID(fileSystem afero.Fs) (string, error)

func InitConfig

func InitConfig(configName string) error

InitConfig intializes the config for the application If no config file is provided with the --config flag it will look for a config in following locations:

Order represents priority /etc/trento/agent.yaml /usr/etc/trento/agent.yaml $HOME/.config/trento/agent.yaml

Types

type Agent

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

func NewAgent

func NewAgent(config *Config) (*Agent, error)

NewAgent returns a new instance of Agent with the given configuration

func (*Agent) Start

func (a *Agent) Start(ctx context.Context) error

Start the Agent. This will start the discovery ticker and the heartbeat ticker

func (*Agent) Stop

func (a *Agent) Stop(ctxCancel context.CancelFunc)

type Config

type Config struct {
	AgentID           string
	InstanceName      string
	DiscoveriesConfig *discovery.DiscoveriesConfig
	FactsServiceURL   string
	PluginsFolder     string
}

Jump to

Keyboard shortcuts

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