runnerartifacts

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package runnerartifacts validates and caches explicit Linux runner releases.

Index

Constants

View Source
const (
	ManifestName     = "runner-manifest.json"
	CurrentFormat    = 1
	MaxManifestBytes = 16 << 10
	MaxArtifactBytes = 256 << 20
)

Variables

View Source
var (
	ErrInvalid     = errors.New("invalid_runner_release")
	ErrUnsupported = errors.New("runner_release_upgrade_required")
	ErrUnavailable = errors.New("runner_release_unavailable")
	ErrIntegrity   = errors.New("runner_release_integrity_failed")
)

Functions

func FileName

func FileName(arch string) (string, error)

func ValidRelease

func ValidRelease(release string) bool

Types

type Artifact

type Artifact struct {
	Manifest Manifest
	Entry    Entry
	Source   *os.File
}

Artifact owns the already verified open file. Its bytes remain subject to the independent upload digest check; callers must Close it after the operation.

func (*Artifact) Close

func (artifact *Artifact) Close() error

type BuildMetadata

type BuildMetadata struct {
	Release      string
	SourceCommit string
	SourceDirty  bool
}

type Cache

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

func NewCache

func NewCache(root string, source Source) (*Cache, error)

func (*Cache) Open

func (cache *Cache) Open(ctx context.Context, release, arch string) (*Artifact, error)

type DirectorySource

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

DirectorySource consumes a locally built release explicitly selected by the developer. It never builds on the desktop or executes a downloaded program.

func NewDirectorySource

func NewDirectorySource(root string) (*DirectorySource, error)

func (*DirectorySource) Fetch

func (source *DirectorySource) Fetch(ctx context.Context, release, name string) (io.ReadCloser, error)

type Entry

type Entry struct {
	OS       string `json:"os"`
	Arch     string `json:"arch"`
	FileName string `json:"file_name"`
	Size     int64  `json:"size"`
	SHA256   string `json:"sha256"`
}

type GitHubSource

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

func NewGitHubSource

func NewGitHubSource(repository string) (*GitHubSource, error)

func (*GitHubSource) Fetch

func (source *GitHubSource) Fetch(ctx context.Context, release, name string) (io.ReadCloser, error)

type Manifest

type Manifest struct {
	Format       int     `json:"format"`
	Contract     int     `json:"contract"`
	Release      string  `json:"release"`
	SourceCommit string  `json:"source_commit"`
	SourceDirty  bool    `json:"source_dirty"`
	Entries      []Entry `json:"entries"`
}

func DecodeManifest

func DecodeManifest(document []byte) (Manifest, error)

Release manifests are generated, owned documents with one current shape. Canonical comparison rejects missing, duplicate, case-changed and extra fields.

func Describe

func Describe(ctx context.Context, directory string, metadata BuildMetadata) (Manifest, error)

Describe reads both previously built executables, checking their ELF target and exact content. It neither builds code nor guesses source metadata.

func (Manifest) Validate

func (manifest Manifest) Validate() error

type Source

type Source interface {
	Fetch(context.Context, string, string) (io.ReadCloser, error)
}

Jump to

Keyboard shortcuts

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