datastore

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MultipleMatchErr = errors.New("multiple matches found")
View Source
var NoMatchErr = errors.New("no match found")
View Source
var UnsupportedOperationErr = errors.New("unsupported operation")

Functions

func GetArtifact

func GetArtifact(index Index, f FilterParams) (releaseversion.Artifact, error)

Types

type Factory

type Factory interface {
	Create(provider ProviderName, name string, options map[string]interface{}) (Index, error)
}

type FilterParams

type FilterParams struct {
	NameExpected bool
	Name         string

	VersionExpected   bool
	Version           string
	VersionConstraint *semver.Constraints

	ChecksumExpected bool
	Checksum         string

	URIExpected bool
	URI         string

	LabelsExpected bool // TODO unnecessary? implied by len > 0
	Labels         []string
}

func FilterParamsFromArtifact

func FilterParamsFromArtifact(artifact releaseversion.Artifact) FilterParams

func FilterParamsFromMap

func FilterParamsFromMap(args map[string]interface{}) (FilterParams, error)

func FilterParamsFromReference

func FilterParamsFromReference(ref releaseversion.Reference) FilterParams

func FilterParamsFromSlug

func FilterParamsFromSlug(slug string) FilterParams

func (*FilterParams) ChecksumSatisfied

func (f *FilterParams) ChecksumSatisfied(actual []metalink.Hash) bool

func (*FilterParams) LabelsSatisfied

func (f *FilterParams) LabelsSatisfied(actuals []string) bool

func (*FilterParams) NameSatisfied

func (f *FilterParams) NameSatisfied(actual string) bool

func (*FilterParams) URISatisfied

func (f *FilterParams) URISatisfied(actualURL []metalink.URL, actualMetaURL []metalink.MetaURL) bool

func (*FilterParams) VersionSatisfied

func (f *FilterParams) VersionSatisfied(actual string) bool

type Index

type Index interface {
	GetName() string
	GetArtifacts(f FilterParams) ([]releaseversion.Artifact, error)
	GetLabels() ([]string, error)
	FlushCache() error
}

type NamedGetter

type NamedGetter func(name string) (Index, error)

type ProviderName

type ProviderName string

Jump to

Keyboard shortcuts

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