release

package
v1.0.8576-8ee7da7 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package release works with the metadata of execution releases.

It answers questions about current release version and which binary to download for which os and architecture.

Index

Constants

View Source
const (
	DefaultReleaseType = "release"
)

Variables

View Source
var (
	ErrNotFound            = o11y.NewWarning("not found")
	ErrListVersionNotReady = errors.New("list version not ready")
)

Functions

func Handler

func Handler(cfg HandlerConfig) func(c *gin.Context)

Types

type HandlerConfig

type HandlerConfig struct {
	List *List

	// Resolver is optional
	Resolver releaseTypeResolver
}

type List

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

func NewList

func NewList(ctx context.Context, name, pinnedVersion, listBaseURL string,
	additionalReleaseTypes ...string) (*List, error)

func (*List) HealthChecks

func (c *List) HealthChecks() (_ string, ready, live func(ctx context.Context) error)

func (*List) Latest

func (c *List) Latest() string

Latest returns the cached version for the default release type.

func (*List) LatestFor

func (c *List) LatestFor(releaseType string) string

LatestFor returns the cached version for a given release type.

func (*List) Lookup

func (c *List) Lookup(ctx context.Context, req Requirements) (resp *Release, err error)

func (*List) Run

func (c *List) Run(ctx context.Context) error

type Release

type Release struct {
	URL      string `json:"url"`
	Checksum string `json:"checksum"`
	Version  string `json:"version"`
}

type Requirements

type Requirements struct {
	Version  string `json:"version" form:"version"`
	Platform string `json:"os" form:"os"`
	Arch     string `json:"arch" form:"arch"`
}

func (*Requirements) QueryParams

func (d *Requirements) QueryParams() (params map[string]string)

QueryParams builds a map[string]string of query params which correspond to the required query params for the release handler.

func (*Requirements) Validate

func (d *Requirements) Validate() error

Jump to

Keyboard shortcuts

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