Help us shape the future of Go! Take the 2026 Go Developer Survey

instanceupdate

package
v1.0.0-rc.12 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package instanceupdate owns authenticated release availability. It does not install releases or claim that a running installation is update-ready.

Index

Constants

View Source
const (
	ManifestName  = "UPDATE-MANIFEST.json"
	NotesName     = "RELEASE-NOTES.md"
	ChecksumsName = "SHA256SUMS"
	BundleName    = "SHA256SUMS.sigstore.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	Name   string `json:"name"`
	SHA256 string `json:"sha256"`
	Size   int64  `json:"size"`
}

type Candidate

type Candidate struct {
	Version  string   `json:"version"`
	Commit   string   `json:"commit"`
	Platform string   `json:"platform"`
	Notes    string   `json:"notes"`
	Archive  Artifact `json:"archive"`
	Evidence Evidence `json:"evidence"`
}

type Compatibility

type Compatibility struct {
	Schema               Range `json:"sourceSchema"`
	Layout               Range `json:"sourceLayout"`
	SchemaResult         int   `json:"schemaResult"`
	LayoutResult         int   `json:"layoutResult"`
	CLIProtocol          int   `json:"cliProtocol"`
	DaemonWorkerProtocol int   `json:"daemonWorkerProtocol"`
	WorkerProtocol       Range `json:"workerProtocol"`
}

type Evidence

type Evidence struct {
	ManifestSHA256  string `json:"manifestSHA256"`
	ChecksumsSHA256 string `json:"checksumsSHA256"`
	Signer          string `json:"signer"`
	Issuer          string `json:"issuer"`
	SourceCommit    string `json:"sourceCommit"`
}

Evidence retains what was authenticated, separate from installed provenance.

type Image

type Image struct {
	Repository string            `json:"repository"`
	Index      string            `json:"index"`
	Platforms  map[string]string `json:"platforms"`
}

type Manifest

type Manifest struct {
	Format        int                 `json:"format"`
	Version       string              `json:"version"`
	Commit        string              `json:"commit"`
	Notes         Artifact            `json:"notes"`
	Archives      map[string]Artifact `json:"archives"`
	Images        map[string]Image    `json:"images"`
	Compatibility Compatibility       `json:"compatibility"`
}

Manifest binds every artifact to one authenticated release. It names what a notification shows; nothing reads it to install a release.

type Options

type Options struct {
	DataDir   string
	Build     string
	Platform  string
	Channel   string
	Authority access.Authorizer
	Now       func() time.Time
	Transport http.RoundTripper
}

Options binds one installation's notification owner. Transport injection is assembly input, not a destination or credential accepted from an HTTP caller.

type Range

type Range struct {
	Min int `json:"min"`
	Max int `json:"max"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(in Options) (*Service, error)

func (*Service) Check

func (s *Service) Check(ctx context.Context) (Status, error)

Check is an explicit administrator request. Concurrent or repeated requests share the owner's cooldown rather than creating unbounded public fetches.

func (*Service) Run

func (s *Service) Run(ctx context.Context) error

Run is public-information discovery under daemon lifetime, never updater execution. The normal daemon calls it; verify-only startup does not.

func (*Service) Status

func (s *Service) Status(ctx context.Context) (Status, error)

type Status

type Status struct {
	Build       string     `json:"build"`
	Platform    string     `json:"platform"`
	Channel     string     `json:"channel"`
	State       string     `json:"state"`
	LastAttempt *time.Time `json:"lastAttempt,omitempty"`
	LastSuccess *time.Time `json:"lastSuccess,omitempty"`
	Candidate   *Candidate `json:"candidate,omitempty"`
	ReasonCode  string     `json:"reasonCode,omitempty"`
	Reason      string     `json:"reason,omitempty"`
}

Jump to

Keyboard shortcuts

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