Documentation ¶
Index ¶
- Variables
- 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) 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
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 AuditChecker ¶ added in v0.57.0
type AuditChecker struct { CheckURL string Client http.Client Version string AnonymizedInstallationID string // contains filtered or unexported fields }
func NewAuditChecker ¶ added in v0.57.0
func NewAuditChecker(checkURL, version, installationID string) *AuditChecker
func NewDefaultAuditChecker ¶ added in v0.57.0
func NewDefaultAuditChecker(checkURL, installationID 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
Click to show internal directories.
Click to hide internal directories.