check

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2022 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	Message  string   `json:"message"`
	Severity Severity `json:"severity"`
}

Alert contains a message about given update and its importance.

type Caller

type Caller interface {
	Call(r *VersionCheckRequest) (*VersionCheckResponse, error)
}

func NewCaller

func NewCaller() Caller

type ProductVersionReport added in v0.3.0

type ProductVersionReport struct {
	Product      string      `json:"product"`
	Current      ReleaseInfo `json:"current"`
	Recommended  ReleaseInfo `json:"recommended"`
	Instructions string      `json:"instructions"`
	Alerts       []Alert     `json:"alerts"`
}

ProductVersionReport contains recommendation about the best version of a product, any alerts for the current version as well as upgrade instructions.

type ReleaseInfo

type ReleaseInfo struct {
	Version     string `json:"version"`
	ReleaseTime int64  `json:"release_time"`
	Notes       string `json:"notes"`
}

ReleaseInfo contains information about a specific version of the product.

type SDKInfo

type SDKInfo struct {
	Name    string `json:"sdkName"`
	Version string `json:"sdkVersion"`
}

SDKINfo is a tuple of (SDK name, SDK version)

type Severity

type Severity int32

Severity defines importance of the upgrade from the current version to the recommended version.

const (
	// SeverityUnspecified means that severity hasn't been set or is unknown.
	SeverityUnspecified Severity = iota
	// SeverityHigh means that there is an important update available and it should be applied ASAP.
	SeverityHigh
	// SeverityMedium means that there is an important update available however it is not urgent.
	SeverityMedium
	// SeverityLow means that no major changes are available and update is not required.
	SeverityLow
)

type VersionCheckRequest

type VersionCheckRequest struct {
	Product   string `json:"product"`
	Version   string `json:"version"`
	Arch      string `json:"arch"`
	OS        string `json:"os"`
	DB        string `json:"db"`
	ClusterID string `json:"cluster"`
	// Encode as string for JS compatibility
	Timestamp int64     `json:"timestamp,string"`
	SDKInfo   []SDKInfo `json:"sdkInfo"`
}

VersionCheckRequest provides basic info about the client and is used to produce VersionCheckResponse.

type VersionCheckResponse

type VersionCheckResponse struct {
	Products []ProductVersionReport `json:"products"`
}

VersionCheckResponse is either a VersionCheckReport (where product is empty) or a list of per product updates.

Jump to

Keyboard shortcuts

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