Documentation ¶
Index ¶
- Constants
- Variables
- func IsVersionUnreleased() bool
- type Alert
- type AuditChecker
- func (a *AuditChecker) Check(ctx context.Context) (*AuditResponse, error)
- func (a *AuditChecker) CheckAndLog(ctx context.Context, log logging.Logger)
- func (a *AuditChecker) CheckLatestVersion() (*LatestVersionResponse, error)
- func (a *AuditChecker) Close()
- func (a *AuditChecker) LastCheck() (*AuditResponse, error)
- func (a *AuditChecker) StartPeriodicCheck(ctx context.Context, interval time.Duration, log logging.Logger) bool
- func (a *AuditChecker) StopPeriodicCheck()
- type AuditResponse
- type CachedVersionSource
- type GithubReleases
- type LatestVersionResponse
- type VersionSource
Constants ¶
View Source
const ( // releases URL DefaultReleasesURL = "https://github.com/treeverse/lakeFS/releases" GithubRepoOwner = "treeverse" GithubRepoName = "lakeFS" )
Variables ¶
View Source
var ( ErrAuditCheckFailed = errors.New("audit check request failed") ErrMissingCheckURL = errors.New("missing audit check URL") )
View Source
var ( ErrInvalidConfig = errors.New("invalid configuration for version source") ErrHTTPStatus = errors.New("unexpected HTTP status code") )
View Source
var ( UnreleasedVersion = "dev" // Version is the current git version of the code. It is filled in by "make build". // Make sure to change that target in Makefile if you change its name or package. Version = "dev" )
Functions ¶
func IsVersionUnreleased ¶ added in v0.98.0
func IsVersionUnreleased() bool
Types ¶
type AuditChecker ¶ added in v0.57.0
type AuditChecker struct { CheckURL string Client http.Client Version string InstallationID string // contains filtered or unexported fields }
func NewAuditChecker ¶ added in v0.57.0
func NewAuditChecker(checkURL, version, installationID string, latestReleases VersionSource) *AuditChecker
func NewDefaultAuditChecker ¶ added in v0.57.0
func NewDefaultAuditChecker(checkURL, installationID string, latestReleases VersionSource) *AuditChecker
func (*AuditChecker) Check ¶ added in v0.57.0
func (a *AuditChecker) Check(ctx context.Context) (*AuditResponse, error)
func (*AuditChecker) CheckAndLog ¶ added in v0.57.0
func (a *AuditChecker) CheckAndLog(ctx context.Context, log logging.Logger)
CheckAndLog performs an audit check, logs and keeps the last response
func (*AuditChecker) CheckLatestVersion ¶ added in v0.98.0
func (a *AuditChecker) CheckLatestVersion() (*LatestVersionResponse, error)
CheckLatestVersion will return the latest version of the current package compared to the current version
func (*AuditChecker) Close ¶ added in v0.57.0
func (a *AuditChecker) Close()
Close release resources used by audit checker - ex: periodic check
func (*AuditChecker) LastCheck ¶ added in v0.57.0
func (a *AuditChecker) LastCheck() (*AuditResponse, error)
func (*AuditChecker) StartPeriodicCheck ¶ added in v0.57.0
func (a *AuditChecker) StartPeriodicCheck(ctx context.Context, interval time.Duration, log logging.Logger) bool
StartPeriodicCheck performs one check and continues every 'interval' in the background check results will be found in the log and updated for 'LastCheck' Return false if periodic check already ran
func (*AuditChecker) StopPeriodicCheck ¶ added in v0.57.0
func (a *AuditChecker) StopPeriodicCheck()
type AuditResponse ¶ added in v0.57.0
type AuditResponse struct { UpgradeURL string `json:"upgrade_url,omitempty"` Alerts []Alert `json:"alerts"` }
func (*AuditResponse) UpgradeRecommendedURL ¶ added in v0.57.0
func (a *AuditResponse) UpgradeRecommendedURL() string
type CachedVersionSource ¶ added in v0.98.0
type CachedVersionSource struct { Source VersionSource // contains filtered or unexported fields }
func NewCachedSource ¶ added in v0.98.0
func NewCachedSource(src VersionSource, cachePeriod time.Duration) *CachedVersionSource
func (*CachedVersionSource) FetchLatestVersion ¶ added in v0.98.0
func (cs *CachedVersionSource) FetchLatestVersion() (string, error)
type GithubReleases ¶ added in v0.98.0
type GithubReleases struct {
// contains filtered or unexported fields
}
func NewGithubReleases ¶ added in v0.98.0
func NewGithubReleases(owner, repository string) *GithubReleases
func (*GithubReleases) FetchLatestVersion ¶ added in v0.98.0
func (gh *GithubReleases) FetchLatestVersion() (string, error)
type LatestVersionResponse ¶ added in v0.98.0
type LatestVersionResponse struct { CheckTime time.Time `json:"check_time"` Outdated bool `json:"outdated"` LatestVersion string `json:"latest_version"` CurrentVersion string `json:"current_version"` }
func CheckLatestVersion ¶ added in v0.98.0
func CheckLatestVersion(targetVersion string) (*LatestVersionResponse, error)
type VersionSource ¶ added in v0.98.0
func NewDefaultVersionSource ¶ added in v0.98.0
func NewDefaultVersionSource(cachePeriod time.Duration) VersionSource
Click to show internal directories.
Click to hide internal directories.