version

package
v1.29.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	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 (
	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"
)
View Source
var ErrHTTPStatus = errors.New("unexpected HTTP status code")

Functions

func IsVersionUnreleased added in v0.98.0

func IsVersionUnreleased() bool

Types

type Alert added in v0.57.0

type Alert struct {
	ID               string `json:"id"`
	AffectedVersions string `json:"affected_versions"`
	PatchedVersions  string `json:"patched_versions"`
	Description      string `json:"description"`
}

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 Source) *AuditChecker

func NewDefaultAuditChecker added in v0.57.0

func NewDefaultAuditChecker(checkURL, installationID string, latestReleases Source) *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 Source
	// contains filtered or unexported fields
}

func NewCachedSource added in v0.98.0

func NewCachedSource(src Source, 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 RepositoryRelease added in v0.109.0

type RepositoryRelease struct {
	TagName    string `json:"tag_name,omitempty"`
	Name       string `json:"name,omitempty"`
	Draft      bool   `json:"draft,omitempty"`
	Prerelease bool   `json:"prerelease,omitempty"`
	ID         int64  `json:"id,omitempty"`
	URL        string `json:"url,omitempty"`
}

type Source added in v0.109.0

type Source interface {
	FetchLatestVersion() (string, error)
}

func NewDefaultVersionSource added in v0.98.0

func NewDefaultVersionSource(cachePeriod time.Duration) Source

Jump to

Keyboard shortcuts

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