agentkapp

package
v16.2.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: MIT Imports: 75 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommand

func NewCommand() *cobra.Command

Types

type App

type App struct {
	Log               *zap.Logger
	LogLevel          zap.AtomicLevel
	GrpcLogLevel      zap.AtomicLevel
	AgentMeta         *entity.AgentMeta
	AgentId           *ValueHolder[int64]
	GitLabExternalUrl *ValueHolder[url.URL]
	// 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

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

type Runner

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()
}

type ValueHolder added in v16.1.0

type ValueHolder[T comparable] struct {
	// contains filtered or unexported fields
}

ValueHolder holds agent id of this agentk.

func NewValueHolder added in v16.1.0

func NewValueHolder[T comparable]() *ValueHolder[T]

Jump to

Keyboard shortcuts

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