Documentation ¶
Index ¶
Constants ¶
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)
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)
Click to show internal directories.
Click to hide internal directories.