Documentation
¶
Index ¶
- Constants
- Variables
- func AssertCompatibleWithPrevious(minAppVersion, previousAppVersion string) error
- func AssertExactDesktopInventory(ctx context.Context, dir, version string) error
- func AssertStrictlyGreater(candidate, live string) error
- func CompatibilityChannels(channel string) ([]string, error)
- func DesktopArtifactNames(version string) []string
- func LoadChannelFiles(dir string) (map[string][]byte, error)
- func MinAppVersion(releaseVersion string, liveVersions []string) (string, error)
- func ValidateDesktopChannel(channel string) error
- func ValidateVersion(version string) error
- func VerifyChecksumsCatalog(ctx context.Context, catalogPath string, artifacts []Artifact) error
- func WriteCompatibility(path string, compatibility Compatibility) error
- type Artifact
- type Authority
- type AuthorityBackend
- type ChannelCommit
- type CommitRequest
- type Compatibility
- type ErrorCode
- type Generation
- type GitHubBackend
- func (b *GitHubBackend) ChannelRef(ctx context.Context, branch string) (string, error)
- func (b *GitHubBackend) Commit(ctx context.Context, request CommitRequest) (string, error)
- func (b *GitHubBackend) CompareAndSwapRef(ctx context.Context, branch, expectedSHA, nextSHA string) error
- func (b *GitHubBackend) FindOperation(ctx context.Context, branch, operationID string) (*ChannelCommit, error)
- func (b *GitHubBackend) KnownGood(ctx context.Context, branch, version string) (ChannelCommit, error)
- func (b *GitHubBackend) ReadCommit(ctx context.Context, sha string) (ChannelCommit, error)
- func (b *GitHubBackend) ReleaseInventory(ctx context.Context, version string) ([]Artifact, error)
- func (b *GitHubBackend) Repository() string
- func (b *GitHubBackend) UploadAsset(ctx context.Context, version, filePath string, artifact Artifact) error
- func (b *GitHubBackend) VerifyAsset(ctx context.Context, version string, artifact Artifact) error
- type HTTPDoer
- type OperatorError
- type OperatorResult
- type PublishRequest
- type RepairRequest
Constants ¶
View Source
const ( ChannelBeta = "beta" ChannelStable = "stable" ChannelBranchPrefix = "channel-" ChannelDirectory = "desktop" ManifestMac = "latest-mac.yml" ManifestLinux = "latest-linux.yml" GenerationFile = "generation.json" CompatibilityFile = "compat.json" ChecksumsFile = "checksums.txt" )
View Source
const DefaultGitHubAPIURL = "https://api.github.com"
Variables ¶
View Source
var ErrChannelRefNotFound = errors.New("desktop release: channel ref not found")
View Source
var ErrCompareAndSwap = errors.New("desktop release: channel ref changed")
Functions ¶
func AssertStrictlyGreater ¶
func CompatibilityChannels ¶
CompatibilityChannels returns the channels whose live apps a release on channel must keep serving. Stable releases also serve the frozen beta channel, whose final bridge release reads the stable feed.
func DesktopArtifactNames ¶
func MinAppVersion ¶
MinAppVersion returns the lowest live app version across the compatibility channels, which the new runtime must keep serving. Without a live channel the release version is its own minimum.
func ValidateDesktopChannel ¶
func ValidateVersion ¶
func VerifyChecksumsCatalog ¶
func WriteCompatibility ¶
func WriteCompatibility(path string, compatibility Compatibility) error
Types ¶
type Artifact ¶
type Authority ¶
type Authority struct {
// contains filtered or unexported fields
}
func NewAuthority ¶
func NewAuthority(backend AuthorityBackend) (*Authority, error)
func (*Authority) Publish ¶
func (a *Authority) Publish(ctx context.Context, request PublishRequest) (OperatorResult, error)
func (*Authority) Repair ¶
func (a *Authority) Repair(ctx context.Context, request RepairRequest) (OperatorResult, error)
type AuthorityBackend ¶
type AuthorityBackend interface {
Repository() string
ChannelRef(ctx context.Context, branch string) (string, error)
FindOperation(ctx context.Context, branch, operationID string) (*ChannelCommit, error)
Commit(ctx context.Context, request CommitRequest) (string, error)
CompareAndSwapRef(ctx context.Context, branch, expectedSHA, nextSHA string) error
ReleaseInventory(ctx context.Context, version string) ([]Artifact, error)
UploadAsset(ctx context.Context, version, path string, artifact Artifact) error
VerifyAsset(ctx context.Context, version string, artifact Artifact) error
ReadCommit(ctx context.Context, sha string) (ChannelCommit, error)
KnownGood(ctx context.Context, branch, version string) (ChannelCommit, error)
}
type ChannelCommit ¶
type ChannelCommit struct {
SHA string
Generation Generation
Files map[string][]byte
}
type CommitRequest ¶
type CommitRequest struct {
ParentSHA string
Generation Generation
Files map[string][]byte
}
type Compatibility ¶
type Compatibility struct {
RuntimeVersion string `json:"runtime_version"`
MinAppVersion string `json:"min_app_version"`
}
func ReadCompatibility ¶
func ReadCompatibility(path string) (Compatibility, error)
type Generation ¶
type Generation struct {
OperationID string `json:"operation_id"`
Operation string `json:"operation"`
Version string `json:"version"`
MinAppVersion string `json:"min_app_version"`
PublishedAt time.Time `json:"published_at"`
SourceCommit string `json:"source_commit,omitempty"`
}
func DecodeGeneration ¶
func DecodeGeneration(contents []byte) (Generation, error)
type GitHubBackend ¶
type GitHubBackend struct {
// contains filtered or unexported fields
}
func NewGitHubBackend ¶
func NewGitHubBackend(client HTTPDoer, apiURL, repository, token string) (*GitHubBackend, error)
func (*GitHubBackend) ChannelRef ¶
func (*GitHubBackend) Commit ¶
func (b *GitHubBackend) Commit(ctx context.Context, request CommitRequest) (string, error)
func (*GitHubBackend) CompareAndSwapRef ¶
func (b *GitHubBackend) CompareAndSwapRef( ctx context.Context, branch, expectedSHA, nextSHA string, ) error
func (*GitHubBackend) FindOperation ¶
func (b *GitHubBackend) FindOperation( ctx context.Context, branch, operationID string, ) (*ChannelCommit, error)
func (*GitHubBackend) KnownGood ¶
func (b *GitHubBackend) KnownGood( ctx context.Context, branch, version string, ) (ChannelCommit, error)
func (*GitHubBackend) ReadCommit ¶
func (b *GitHubBackend) ReadCommit(ctx context.Context, sha string) (ChannelCommit, error)
func (*GitHubBackend) ReleaseInventory ¶
func (*GitHubBackend) Repository ¶
func (b *GitHubBackend) Repository() string
func (*GitHubBackend) UploadAsset ¶
func (*GitHubBackend) VerifyAsset ¶
type OperatorError ¶
func (*OperatorError) Error ¶
func (e *OperatorError) Error() string
func (*OperatorError) Unwrap ¶
func (e *OperatorError) Unwrap() error
type OperatorResult ¶
type PublishRequest ¶
Click to show internal directories.
Click to hide internal directories.