artifacts

package
v0.11.0 Latest Latest
Warning

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

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

README

artifacts

This package was moved to apis/artifacts/v1alpha1 and is now deprecated

Documentation

Overview

Package artifacts provide functions to artifacts

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindMatchedTagByPrefix added in v0.8.0

func FindMatchedTagByPrefix(ctx context.Context, currentTag string, opts FindMatchedTagByPrefixOptions, candidates ...string) (tag string, ok bool)

FindMatchedTagByPrefix selects the best matched tag using a prefix, for example current tag = v1.8.0 candidates are v1.8.1, v1.9.0, v2.0.0 will return v1.8.1 because the most number for characters were matched

Types

type AllFilter deprecated

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

AllFilter will use AND logic between items in other words, it equals item[0] && item[1] && ... item[n] (n>=0)

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func (AllFilter) Filter deprecated

func (f AllFilter) Filter(ctx context.Context, artifact v1alpha1.Artifact) (FilterResult, string, error)

Filter will filter artifacts by all filters

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

type AnyFilter deprecated

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

AnyFilter will use OR logic between items in other words, it equals item[0] || item[1] || ... item[n] (n>=0)

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func (AnyFilter) Filter deprecated

func (f AnyFilter) Filter(ctx context.Context, artifact v1alpha1.Artifact) (FilterResult, string, error)

Filter will filter artifacts by filters using OR logic

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

type DigestAlgorithm deprecated

type DigestAlgorithm string

DigestAlgorithm artifact digest algorithm

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

const (
	// SHA256 artifact digest algorithm is sha256
	//
	// Deprecated: use pkg/apis/artifacts/v1alpha1 instead
	SHA256 DigestAlgorithm = "sha256"
)

type EnvFilter deprecated

type EnvFilter struct {
	v1alpha1.ArtifactEnvFilter
}

EnvFilter represents artifact env filter

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func (EnvFilter) Filter deprecated

func (filter EnvFilter) Filter(ctx context.Context, artifact v1alpha1.Artifact) (FilterResult, string, error)

Filter will filter artifacts by artifact envs

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

type Filter deprecated

type Filter interface {
	// Filter compute the predicate on the provided event and returns the result of the matching
	// message will be match details when not pass
	Filter(ctx context.Context, artifact v1alpha1.Artifact) (res FilterResult, message string, err error)
}

Filter is artifact filter interfact

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func NewAllFilter deprecated

func NewAllFilter(all []v1alpha1.ArtifactFilter) Filter

NewAllFilter will construct all filter

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func NewAnyFilter deprecated

func NewAnyFilter(any []v1alpha1.ArtifactFilter) Filter

NewAnyFilter will construct filters using OR logic

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func NewEnvFilter deprecated

func NewEnvFilter(f v1alpha1.ArtifactEnvFilter) Filter

NewEnvFilter will construct artifact env filter

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func NewFilter deprecated

func NewFilter(filters ...v1alpha1.ArtifactFilterSet) Filter

NewFilter create Filter by filters, will use AND logic between items

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func NewLabelFilter deprecated

func NewLabelFilter(f v1alpha1.ArtifactLabelFilter) Filter

NewLabelFilter will construct artifact label filter

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func NewTagFilter deprecated

func NewTagFilter(f v1alpha1.ArtifactTagFilter) Filter

NewTagFilter will construct artifact tag filter

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

type FilterResult

type FilterResult string

FilterResult has the result of the filtering operation. Deprecated: use pkg/apis/artifacts/v1alpha1 instead

const (
	// indicates pass filter result
	//
	// Deprecated: use pkg/apis/artifacts/v1alpha1 instead
	PassFilter FilterResult = "pass"
	// indicates fail filter result
	//
	// Deprecated: use pkg/apis/artifacts/v1alpha1 instead
	FailFilter FilterResult = "fail"
	// indicates no filter result
	//
	// Deprecated: use pkg/apis/artifacts/v1alpha1 instead
	NoFilter FilterResult = "no_filter"
)

func NewFilterResult

func NewFilterResult(matched bool) FilterResult

NewFilterResult will parse bool to filterresult Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func (FilterResult) And

And will use AND logic between two filter result if any one is NoFilter will return other one if all are pass will return pass if one is fail will return fail Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func (FilterResult) Not

func (x FilterResult) Not() FilterResult

Not if current FilterResult is pass , will retrun fail if current FilterResult is faile, will return pass if current FilterResult is no filter , will return no filter Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func (FilterResult) Or

Or will use OR logic between two filter result if any one is NoFilter will return other one if any one is pass will return pass if all items are fail will return fail Deprecated: use pkg/apis/artifacts/v1alpha1 instead

type Filters deprecated

type Filters []Filter

Filters is a wrapper that runs each filter and performs the and

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func NewArtifactFilter deprecated

func NewArtifactFilter(filter v1alpha1.ArtifactFilter) Filters

NewArtifactFilter will construct a ArtifactFilter

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func (Filters) Filter deprecated

func (filters Filters) Filter(ctx context.Context, artifact v1alpha1.Artifact) (FilterResult, string, error)

Filter compute the predicate on the provided event and returns the result of the matching

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

type FindMatchedTagByPrefixOptions added in v0.8.0

type FindMatchedTagByPrefixOptions struct {
	// MinNumberOfCharacterMatches stores the minimum allowed number of characters to be matched
	// in order to consider a valid candidate
	// defaults to 0 (no minimal limit)
	MinNumberOfCharacterMatches int
}

FindMatchedTagByPrefixOptions options for FindMatchedTagByPrefix function

type LabelFilter deprecated

type LabelFilter struct {
	v1alpha1.ArtifactLabelFilter
}

LabelFilter artifact label filter

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func (LabelFilter) Filter deprecated

func (filter LabelFilter) Filter(ctx context.Context, artifact v1alpha1.Artifact) (FilterResult, string, error)

Filter will filter artifacts by artifact labels

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

type Protocol deprecated

type Protocol string

Protocol represent artifact transport protocol

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

var (
	// ProtocolDocker docker protocol
	//
	// Deprecated: use pkg/apis/artifacts/v1alpha1 instead
	ProtocolDocker Protocol = "docker"
	// ProtocolHelmChart helm chart protocol
	//
	// Deprecated: use pkg/apis/artifacts/v1alpha1 instead
	ProtocolHelmChart Protocol = "chart"
	// ProtocolOCI oci protocol
	//
	// Deprecated: use pkg/apis/artifacts/v1alpha1 instead
	ProtocolOCI Protocol = "oci"

	//
	// Deprecated: use pkg/apis/artifacts/v1alpha1 instead
	ErrInvalidReference = "invalid reference"
)

type TagFilter deprecated

type TagFilter struct {
	v1alpha1.ArtifactTagFilter
}

TagFilter represents artifact tag filter

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func (TagFilter) Filter deprecated

func (filter TagFilter) Filter(ctx context.Context, artifact v1alpha1.Artifact) (FilterResult, string, error)

Filter will filter artifacts by artifact tags

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

type URI deprecated

type URI struct {
	// Protocol represent artifact transport protocol, it is optional, default value is docker
	Protocol string
	// Host represent artifact host
	Host string
	// Path represent artifact path
	Path string
	// Tag represent artifact tag
	Tag string
	// Digest represent artifact digest
	Digest string
	// Algorithm digest algorithm
	Algorithm DigestAlgorithm

	// Raw represent original uri
	Raw string
}

URI represents artifact uri , like docker://gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/nop:v0.37.1@sha256:04411f239bc7144c3248b53af6741c2726eaddbe9b9cf62a24cf812689cc3223

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func ParseURI deprecated

func ParseURI(uri string, t metav1alpha1.ArtifactType) (URI, error)

ParseURI parse uri to URI struct

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func (URI) DigestString deprecated

func (u URI) DigestString() string

DigestString will return format of Algorithm:Digest

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func (URI) String deprecated

func (u URI) String() string

String returns the uri string, preferably using tag as a reference.

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func (URI) Validate deprecated

func (u URI) Validate() error

Validate returns an error if the uri is invalid, otherwise returns empty.

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func (URI) ValidateDigest deprecated

func (u URI) ValidateDigest() error

ValidateDigest validates the a digest.

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func (URI) ValidateHost deprecated

func (u URI) ValidateHost() error

ValidateHost validates the host.

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func (URI) ValidatePath deprecated

func (u URI) ValidatePath() error

ValidatePath validates the path.

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func (URI) ValidateTag deprecated

func (u URI) ValidateTag() error

ValidateTag validates the tag.

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func (URI) Version deprecated

func (u URI) Version() string

Version will return sha256:xx or tag .

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

func (URI) WithDigestString deprecated

func (u URI) WithDigestString() string

WithDigestString return uri string, including tag and digest.

Deprecated: use pkg/apis/artifacts/v1alpha1 instead

Jump to

Keyboard shortcuts

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