version

package
v0.57.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

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"
)

Functions

This section is empty.

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
	// contains filtered or unexported fields
}

func NewAuditChecker added in v0.57.0

func NewAuditChecker(checkURL, version string) *AuditChecker

func NewDefaultAuditChecker added in v0.57.0

func NewDefaultAuditChecker(checkURL string) *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) 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

Jump to

Keyboard shortcuts

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