address

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetVersionFromPath

func GetVersionFromPath(path string) string

func ParseSource

func ParseSource(source string) (string, string, error)

ParseSource return a registry hostname and namespace if the source is an empty string or . the source is local to the filesystem, returns empty hostname and namespace if the source is not local we expect a delineation with a / between a registry hostname and a namespace

Types

type Address

type Address struct {
	HostName  string
	Namespace string
	Name      string
}

func (Address) IsLocal

func (r Address) IsLocal() bool

func (Address) Path

func (r Address) Path() string

func (Address) ProjectName

func (r Address) ProjectName() string

type Asset

type Asset struct {
	Name               string     `json:"name"`
	ContentType        string     `json:"content_type"`
	State              AssetState `json:"state"`
	BrowserDownloadURL string     `json:"browser_download_url"`
}

type AssetState

type AssetState string
const (
	AssetStateUpLoaded AssetState = "uploaded"
)

type Image

type Image struct {
	Name    string
	Version string
	Platform
	URL string
}

type Images

type Images []Image

type Package

type Package struct {
	Address            *Address
	Platform           *Platform
	AvailableVersions  versions.List
	VersionConstraints string
	CandidateVersions  versions.List
	SelectedVersion    string
}

func GetPackage

func GetPackage(nsn store.Key, source string) (*Package, error)

address -> hostname, namespace, name

func GetPackageFromRef

func GetPackageFromRef(ref string) (*Package, error)

func (*Package) AddConstraints

func (r *Package) AddConstraints(constraint string)

func (*Package) BasePath

func (r *Package) BasePath() string

func (*Package) ChecksumURL

func (r *Package) ChecksumURL(version string) string

func (*Package) DirPath

func (r *Package) DirPath(version string) string

func (*Package) ExecPath

func (r *Package) ExecPath() string

func (*Package) FilePath

func (r *Package) FilePath(version string) string

func (*Package) FilePathWithSelectedVersion

func (r *Package) FilePathWithSelectedVersion() string

func (*Package) Filename

func (r *Package) Filename() string

filename is aligned with go releaser

func (*Package) GenerateCandidates

func (r *Package) GenerateCandidates() error

func (*Package) GetRawRefWithVersion

func (r *Package) GetRawRefWithVersion(version string) string

func (*Package) GetRef

func (r *Package) GetRef() string

func (*Package) GetReleases

func (r *Package) GetReleases(ctx context.Context) (Releases, error)

GetReleases returns the avilable releases/versions of the package

func (*Package) GetRemoteChecksum

func (r *Package) GetRemoteChecksum(ctx context.Context, version string) (string, error)

func (*Package) GetSelectedVersion

func (r *Package) GetSelectedVersion() string

func (*Package) GetVersionRef

func (r *Package) GetVersionRef() string

func (*Package) HasVersion

func (r *Package) HasVersion(version string) bool

func (*Package) IsLocal

func (r *Package) IsLocal() bool

func (*Package) Newest

func (r *Package) Newest() string

func (*Package) ReleasesURL

func (r *Package) ReleasesURL() string

func (*Package) URL

func (r *Package) URL(version string) string

func (*Package) UpdateSelectedVersion

func (r *Package) UpdateSelectedVersion(version string)

type Platform

type Platform struct {
	OS, Arch string
}

func (Platform) String

func (r Platform) String() string

type Release

type Release struct {
	Name    string  `json:"name"`
	TagName string  `json:"tag_name"`
	Assets  []Asset `json:"assets,omitempty"`
}

func (*Release) GetImageData

func (r *Release) GetImageData(ctx context.Context) (Images, error)

type Releases

type Releases []Release

func (Releases) GetRelease

func (r Releases) GetRelease(version string) *Release

Jump to

Keyboard shortcuts

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