cr

package
v1.76.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extract added in v1.66.0

func Extract(image crv1.Image) (io.ReadCloser, error)

Extract flattens the image to a single layer and returns ReadCloser for fetching the content

func GetHTTPTransport

func GetHTTPTransport(ca string) http.RoundTripper

Types

type Client

type Client interface {
	Image(ctx context.Context, tag string) (crv1.Image, error)
	Digest(ctx context.Context, tag string) (string, error)
	ListTags(ctx context.Context) ([]string, error)
}

func NewClient

func NewClient(repo string, options ...Option) (Client, error)

NewClient creates container registry client using `repo` as prefix for tags passed to methods. If insecure flag is set to true, then no cert validation is performed. Repo example: "cr.example.com/ns/app"

type ClientMock

type ClientMock struct {
	DigestMock mClientMockDigest

	ImageMock mClientMockImage

	ListTagsMock mClientMockListTags
	// contains filtered or unexported fields
}

ClientMock implements Client

func NewClientMock

func NewClientMock(t minimock.Tester) *ClientMock

NewClientMock returns a mock for Client

func (*ClientMock) Digest

func (mmDigest *ClientMock) Digest(ctx context.Context, tag string) (s1 string, err error)

Digest implements Client

func (*ClientMock) DigestAfterCounter

func (mmDigest *ClientMock) DigestAfterCounter() uint64

DigestAfterCounter returns a count of finished ClientMock.Digest invocations

func (*ClientMock) DigestBeforeCounter

func (mmDigest *ClientMock) DigestBeforeCounter() uint64

DigestBeforeCounter returns a count of ClientMock.Digest invocations

func (*ClientMock) Image

func (mmImage *ClientMock) Image(ctx context.Context, tag string) (i1 v1.Image, err error)

Image implements Client

func (*ClientMock) ImageAfterCounter

func (mmImage *ClientMock) ImageAfterCounter() uint64

ImageAfterCounter returns a count of finished ClientMock.Image invocations

func (*ClientMock) ImageBeforeCounter

func (mmImage *ClientMock) ImageBeforeCounter() uint64

ImageBeforeCounter returns a count of ClientMock.Image invocations

func (*ClientMock) ListTags added in v1.44.0

func (mmListTags *ClientMock) ListTags(ctx context.Context) (sa1 []string, err error)

ListTags implements Client

func (*ClientMock) ListTagsAfterCounter added in v1.44.0

func (mmListTags *ClientMock) ListTagsAfterCounter() uint64

ListTagsAfterCounter returns a count of finished ClientMock.ListTags invocations

func (*ClientMock) ListTagsBeforeCounter added in v1.44.0

func (mmListTags *ClientMock) ListTagsBeforeCounter() uint64

ListTagsBeforeCounter returns a count of ClientMock.ListTags invocations

func (*ClientMock) MinimockDigestDone

func (m *ClientMock) MinimockDigestDone() bool

MinimockDigestDone returns true if the count of the Digest invocations corresponds the number of defined expectations

func (*ClientMock) MinimockDigestInspect

func (m *ClientMock) MinimockDigestInspect()

MinimockDigestInspect logs each unmet expectation

func (*ClientMock) MinimockFinish

func (m *ClientMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*ClientMock) MinimockImageDone

func (m *ClientMock) MinimockImageDone() bool

MinimockImageDone returns true if the count of the Image invocations corresponds the number of defined expectations

func (*ClientMock) MinimockImageInspect

func (m *ClientMock) MinimockImageInspect()

MinimockImageInspect logs each unmet expectation

func (*ClientMock) MinimockListTagsDone added in v1.44.0

func (m *ClientMock) MinimockListTagsDone() bool

MinimockListTagsDone returns true if the count of the ListTags invocations corresponds the number of defined expectations

func (*ClientMock) MinimockListTagsInspect added in v1.44.0

func (m *ClientMock) MinimockListTagsInspect()

MinimockListTagsInspect logs each unmet expectation

func (*ClientMock) MinimockWait

func (m *ClientMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

type ClientMockDigestExpectation

type ClientMockDigestExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockDigestExpectation specifies expectation struct of the Client.Digest

func (*ClientMockDigestExpectation) Then

Then sets up Client.Digest return parameters for the expectation previously defined by the When method

type ClientMockDigestExpectationOrigins added in v1.70.0

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

ClientMockDigestOrigins contains origins of expectations of the Client.Digest

type ClientMockDigestParamPtrs added in v1.70.0

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

ClientMockDigestParamPtrs contains pointers to parameters of the Client.Digest

type ClientMockDigestParams

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

ClientMockDigestParams contains parameters of the Client.Digest

type ClientMockDigestResults

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

ClientMockDigestResults contains results of the Client.Digest

type ClientMockImageExpectation

type ClientMockImageExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockImageExpectation specifies expectation struct of the Client.Image

func (*ClientMockImageExpectation) Then

Then sets up Client.Image return parameters for the expectation previously defined by the When method

type ClientMockImageExpectationOrigins added in v1.70.0

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

ClientMockImageOrigins contains origins of expectations of the Client.Image

type ClientMockImageParamPtrs added in v1.70.0

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

ClientMockImageParamPtrs contains pointers to parameters of the Client.Image

type ClientMockImageParams

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

ClientMockImageParams contains parameters of the Client.Image

type ClientMockImageResults

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

ClientMockImageResults contains results of the Client.Image

type ClientMockListTagsExpectation added in v1.44.0

type ClientMockListTagsExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

ClientMockListTagsExpectation specifies expectation struct of the Client.ListTags

func (*ClientMockListTagsExpectation) Then added in v1.70.0

Then sets up Client.ListTags return parameters for the expectation previously defined by the When method

type ClientMockListTagsExpectationOrigins added in v1.70.0

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

ClientMockListTagsOrigins contains origins of expectations of the Client.ListTags

type ClientMockListTagsParamPtrs added in v1.70.0

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

ClientMockListTagsParamPtrs contains pointers to parameters of the Client.ListTags

type ClientMockListTagsParams added in v1.70.0

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

ClientMockListTagsParams contains parameters of the Client.ListTags

type ClientMockListTagsResults added in v1.44.0

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

ClientMockListTagsResults contains results of the Client.ListTags

type Option

type Option func(options *registryOptions)

func WithCA

func WithCA(ca string) Option

WithCA use custom CA certificate

func WithDockerCfgAuth added in v1.76.0

func WithDockerCfgAuth(dockerCfg string) Option

WithDockerCfgAuth sets authentication using a base64-encoded docker config JSON. If empty, this option is a no-op.

func WithInsecureSchema

func WithInsecureSchema(insecure bool) Option

WithInsecureSchema use http schema instead of https

func WithTimeout added in v1.56.0

func WithTimeout(timeout time.Duration) Option

WithTimeout limit and request to a registry with a timeout default timeout is 30 seconds

func WithUserAgent added in v1.54.0

func WithUserAgent(ua string) Option

WithUserAgent adds ua string to the User-Agent header

func WithUserPasswordAuth added in v1.76.0

func WithUserPasswordAuth(login, password string) Option

WithUserPasswordAuth sets authentication using a plain-text username and password. Takes priority over WithDockerCfgAuth and WithCredentialsBase64.

Jump to

Keyboard shortcuts

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