artifact

package
v0.7.0-beta2 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package artifact define abstract artifacts.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidName    = errors.New(`invalid artifact name (must match "[a-z]+[a-z0-9-_]*)"`)
	ErrInvalidVersion = errors.New(`invalid artifact version (must be a valid semver string)`)
	ErrInvalidRef     = errors.New(`invalid artifact reference (must be in the format "name:version")`)
)

Artifacts errors.

Functions

func ValidateName

func ValidateName(name string) error

ValidateName returns an error if the given name is not a valid artifact name.

func ValidateVersion

func ValidateVersion(ver string) error

ValidateVersion returns an error if the given name is not a valid artifact version.

Artifact version must be a semver string (see https://semver.org/).

Types

type Artifact

type Artifact struct {
	Name    string
	Version string
}

Artifact represents a generic artifact release.

func New

func New(name, version string) (*Artifact, error)

New returns a new valid Artifact.

Return an error if the given name or version are not valid.

func ParseRef

func ParseRef(artifactRef string) (*Artifact, error)

ParseRef returns a new valid Artifact from a given reference in the "name:version" format.

Return an error if the given reference is not valid.

Jump to

Keyboard shortcuts

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