agent

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// MinSyncAgentVersionsInterval is the minimum value for the SyncAgentVersionsInterval setting, currently 1 hour. 0
	// can also be specified to disable background periodic syncing.
	MinSyncAgentVersionsInterval = 1 * time.Hour
)

The latest version cache keeps the latest version in memory to avoid hitting the store to get the latest version.

View Source
const (
	// VersionLatest can be used in requests instead of an actual version
	VersionLatest = "latest"
)

Variables

View Source
var (
	// ErrVersionNotFound is returned when the agent versions service returns a 404 for a version
	ErrVersionNotFound = errors.New("agent version not found")
)

Functions

This section is empty.

Types

type Client

type Client interface {
	Version(version string) (*model.AgentVersion, error)
	Versions() ([]*model.AgentVersion, error)
	LatestVersion() (*model.AgentVersion, error)
}

Client TODO(doc)

func NewClient

func NewClient() Client

NewClient constructs a new Client implementation with the specified settings.

type Versions

type Versions interface {
	LatestVersionString() string
	LatestVersion() (*model.AgentVersion, error)
	Version(version string) (*model.AgentVersion, error)

	SyncVersion(version string) (*model.AgentVersion, error)
	SyncVersions() ([]*model.AgentVersion, error)
}

Versions manages versions of agents that are used during install and upgrade. The versions are stored in the Store as agent-version resources, but Versions provides quick access to the latest version.

func NewVersions

func NewVersions(ctx context.Context, client Client, store store.Store, settings VersionsSettings) Versions

NewVersions creates an implementation of Versions using the specified client, cache, and settings. To disable caching, pass nil for the Cache.

type VersionsSettings

type VersionsSettings struct {
	Logger *zap.Logger

	// SyncAgentVersionsInterval is the interval at which SyncVersions() will be called to ensure the agent-versions are
	// in sync with GitHub and new releases are available.
	SyncAgentVersionsInterval time.Duration

	// Offline is true if the server is in offline mode and should not contact GitHub automatically. Sync methods called
	// by 'bindplanectl sync' commands will still attempt to contact GitHub.
	Offline bool
}

VersionsSettings TODO(doc)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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