tag

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package tag is used for wrapping tag lists

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerList

type DockerList struct {
	Name string   `json:"name"`
	Tags []string `json:"tags"`
}

DockerList is returned from registry/2.0 API's.

func (DockerList) GetTags

func (tl DockerList) GetTags() ([]string, error)

GetTags returns the tags from a list.

func (DockerList) MarshalPretty

func (tl DockerList) MarshalPretty() ([]byte, error)

MarshalPretty is used for printPretty template formatting.

type GCRList

type GCRList struct {
	Children  []string                   `json:"child,omitempty"`
	Manifests map[string]GCRManifestInfo `json:"manifest,omitempty"`
}

GCRList fields are from gcr.io.

type GCRManifestInfo

type GCRManifestInfo struct {
	Size      uint64    `json:"imageSizeBytes"`
	MediaType string    `json:"mediaType"`
	Created   time.Time `json:"timeCreatedMs"`
	Uploaded  time.Time `json:"timeUploadedMs"`
	Tags      []string  `json:"tag"`
}

GCRManifestInfo is a Manifests entry is the output of List and Walk.

func (GCRManifestInfo) MarshalJSON

func (m GCRManifestInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*GCRManifestInfo) UnmarshalJSON

func (m *GCRManifestInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler

type LayoutList added in v0.5.2

type LayoutList struct {
	Index ociv1.Index
}

LayoutList includes the OCI Index from an OCI Layout.

type List

type List struct {
	DockerList
	GCRList
	LayoutList
	// contains filtered or unexported fields
}

List contains a tag list. Currently this is a struct but the underlying type could be changed to an interface in the future. Using methods is recommended over directly accessing fields.

func New

func New(opts ...Opts) (*List, error)

New creates a tag list from options. Tags may be provided directly, or they will be parsed from the raw input based on the media type.

func (*List) Append added in v0.4.5

func (l *List) Append(add *List) error

Append extends a tag list with another.

func (List) GetOrig

func (t List) GetOrig() interface{}

GetOrig returns the underlying tag data structure if defined.

func (List) GetURL added in v0.4.5

func (t List) GetURL() *url.URL

GetURL returns the URL of the request.

func (List) MarshalJSON

func (t List) MarshalJSON() ([]byte, error)

MarshalJSON returns the tag list in json.

func (List) RawBody

func (t List) RawBody() ([]byte, error)

RawBody returns the original tag list response.

func (List) RawHeaders

func (t List) RawHeaders() (http.Header, error)

RawHeaders returns the received http headers.

type Opts

type Opts func(*tagConfig)

Opts defines options for creating a new tag.

func WithHeaders

func WithHeaders(header http.Header) Opts

WithHeaders includes data from http headers when creating tag list.

func WithLayoutIndex added in v0.5.2

func WithLayoutIndex(index ociv1.Index) Opts

WithLayoutIndex include the index from an OCI Layout.

func WithMT

func WithMT(mt string) Opts

WithMT sets the returned media type on the tag list.

func WithRaw

func WithRaw(raw []byte) Opts

WithRaw defines the raw response from the tag list request.

func WithRef

func WithRef(ref ref.Ref) Opts

WithRef specifies the reference (repository) associated with the tag list.

func WithResp added in v0.4.5

func WithResp(resp *http.Response) Opts

WithResp includes the response from an http request.

func WithTags

func WithTags(tags []string) Opts

WithTags provides the parsed tags for the tag list.

Jump to

Keyboard shortcuts

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