agentkapp

package
v15.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: MIT Imports: 71 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommand

func NewCommand() *cobra.Command

Types

type AgentIdHolder added in v15.4.0

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

AgentIdHolder holds agent id of this agentk.

func NewAgentIdHolder added in v15.4.0

func NewAgentIdHolder() *AgentIdHolder

type App

type App struct {
	Log          *zap.Logger
	LogLevel     zap.AtomicLevel
	GrpcLogLevel zap.AtomicLevel
	AgentMeta    *modshared.AgentMeta
	AgentId      *AgentIdHolder
	// KasAddress specifies the address of kas.
	KasAddress                 string
	KasCACertFile              string
	KasHeaders                 []string
	ServiceAccountName         string
	ObservabilityListenNetwork string
	ObservabilityListenAddress string
	ObservabilityCertFile      string
	ObservabilityKeyFile       string
	TokenFile                  string
	K8sClientGetter            genericclioptions.RESTClientGetter
}

func (*App) Run

func (a *App) Run(ctx context.Context) (retErr error)

type LeaderElector added in v15.4.0

type LeaderElector interface {
	Run(ctx context.Context, onStartedLeading, onStoppedLeading func())
}

type Runner added in v15.4.0

type Runner interface {
	// RunWhenLeader runs f when it is elected as the leader.
	// Provided context signals done when leadership is lost or when the program is terminating.
	// f may be called, stopped, called multiple times, depending on leadership status.
	// The returned function can be used to signal f to stop if it's already running or to avoid running it
	// if elected as the leader. The returned function blocks until f returns.
	RunWhenLeader(f func(context.Context)) func()
}

Jump to

Keyboard shortcuts

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