Documentation ¶
Overview ¶
Package artifacts provide functions to artifacts
Deprecated: use pkg/apis/artifacts/v1alpha1 instead
Index ¶
- func FindMatchedTagByPrefix(ctx context.Context, currentTag string, opts FindMatchedTagByPrefixOptions, ...) (tag string, ok bool)
- type AllFilterdeprecated
- type AnyFilterdeprecated
- type DigestAlgorithmdeprecated
- type EnvFilterdeprecated
- type Filterdeprecated
- func NewAllFilter(all []v1alpha1.ArtifactFilter) Filterdeprecated
- func NewAnyFilter(any []v1alpha1.ArtifactFilter) Filterdeprecated
- func NewEnvFilter(f v1alpha1.ArtifactEnvFilter) Filterdeprecated
- func NewFilter(filters ...v1alpha1.ArtifactFilterSet) Filterdeprecated
- func NewLabelFilter(f v1alpha1.ArtifactLabelFilter) Filterdeprecated
- func NewTagFilter(f v1alpha1.ArtifactTagFilter) Filterdeprecated
- type FilterResult
- type Filtersdeprecated
- type FindMatchedTagByPrefixOptions
- type LabelFilterdeprecated
- type Protocoldeprecated
- type TagFilterdeprecated
- type URIdeprecated
- func (u URI) DigestString() stringdeprecated
- func (u URI) String() stringdeprecated
- func (u URI) Validate() errordeprecated
- func (u URI) ValidateDigest() errordeprecated
- func (u URI) ValidateHost() errordeprecated
- func (u URI) ValidatePath() errordeprecated
- func (u URI) ValidateTag() errordeprecated
- func (u URI) Version() stringdeprecated
- func (u URI) WithDigestString() stringdeprecated
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
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
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
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 ¶
func (x FilterResult) And(y FilterResult) FilterResult
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 ¶
func (x FilterResult) Or(y FilterResult) FilterResult
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
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
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