Documentation ¶
Index ¶
- Variables
- func CheckProcessVersion(ctx context.Context, log *zap.Logger, config Config, info version.Info, ...) (err error)
- type Chore
- type Client
- func (client *Client) All(ctx context.Context) (ver version.AllowedVersions, err error)
- func (client *Client) OldMinimum(ctx context.Context, serviceName string) (ver version.OldSemVer, err error)
- func (client *Client) Process(ctx context.Context, processName string) (process version.Process, err error)
- type ClientConfig
- type Config
- type Service
- func (service *Service) CheckVersion(ctx context.Context) (latest version.SemVer, err error)
- func (service *Service) Checked() bool
- func (service *Service) GetCursor(ctx context.Context) (_ version.RolloutBytes, err error)
- func (service *Service) IsAllowed(ctx context.Context) (version.SemVer, bool)
- func (service *Service) SetAcceptedVersion(version version.SemVer)
Constants ¶
This section is empty.
Variables ¶
var ( // Error is the error class for version checker client errors. Error = errs.Class("version checker client") )
Functions ¶
Types ¶
type Chore ¶ added in v0.35.2
Chore contains the information and variables to ensure the Software is up to date.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client defines helper methods for using version control server response data.
architecture: Client
func (*Client) OldMinimum ¶
func (client *Client) OldMinimum(ctx context.Context, serviceName string) (ver version.OldSemVer, err error)
OldMinimum returns the version with the given name at the root-level of the version control response. NB: This will be deprecated eventually in favor of what is currently the `processes` root-level object.
type ClientConfig ¶
type ClientConfig struct { ServerAddress string `help:"server address to check its version against" default:"https://version.storj.io"` RequestTimeout time.Duration `help:"Request timeout for version checks" default:"0h1m0s"` }
ClientConfig is the config struct for the version control client.
type Config ¶
type Config struct { ClientConfig CheckInterval time.Duration `help:"Interval to check the version" default:"0h15m0s"` }
Config contains the necessary Information to check the Software Version.
type Service ¶
Service contains the information and variables to ensure the Software is up to date.
architecture: Service
func NewService ¶
func NewService(log *zap.Logger, config Config, info version.Info, service string) (client *Service)
NewService creates a Version Check Client with default configuration.
func (*Service) CheckVersion ¶
CheckVersion checks to make sure the version is still relevant and returns suggested version, returning an error if not.
func (*Service) SetAcceptedVersion ¶ added in v1.9.1
SetAcceptedVersion changes accepted version to specific for tests.