dockerhubapi

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package dockerhubapi is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetToken(ctx context.Context, repository string) (token DockerHubToken, err error)
	GetDigest(ctx context.Context, token DockerHubToken, repository string, tag string) (digest DockerImageDigest, err error)
	GetDigestCached(ctx context.Context, repository string, tag string) (digest DockerImageDigest, err error)
}

Client communicates with docker hub api

func NewClient

func NewClient() Client

NewClient returns a new dockerhubapi.Client

func NewLoggingClient

func NewLoggingClient(c Client) Client

NewLoggingClient returns a new instance of a logging Client.

func NewMetricsClient

func NewMetricsClient(c Client, requestCount metrics.Counter, requestLatency metrics.Histogram) Client

NewMetricsClient returns a new instance of a metrics Client.

func NewTracingClient

func NewTracingClient(c Client) Client

NewTracingClient returns a new instance of a tracing Client.

type DockerHubToken

type DockerHubToken struct {
	Token     string    `json:"token"`
	ExpiresIn int       `json:"expires_in"`
	IssuedAt  time.Time `json:"issued_at"`
}

DockerHubToken is a bearer token to authenticate requests with

func (*DockerHubToken) ExpiresAt

func (t *DockerHubToken) ExpiresAt() time.Time

func (*DockerHubToken) IsExpired

func (t *DockerHubToken) IsExpired() bool

type DockerImageDigest

type DockerImageDigest struct {
	Digest    string
	ExpiresIn int
	FetchedAt time.Time
}

func (*DockerImageDigest) ExpiresAt

func (t *DockerImageDigest) ExpiresAt() time.Time

func (*DockerImageDigest) IsExpired

func (t *DockerImageDigest) IsExpired() bool

type MockClient

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

MockClient is a mock of Client interface

func NewMockClient

func NewMockClient(ctrl *gomock.Controller) *MockClient

NewMockClient creates a new mock instance

func (*MockClient) EXPECT

func (m *MockClient) EXPECT() *MockClientMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockClient) GetDigest

func (m *MockClient) GetDigest(ctx context.Context, token DockerHubToken, repository, tag string) (DockerImageDigest, error)

GetDigest mocks base method

func (*MockClient) GetDigestCached

func (m *MockClient) GetDigestCached(ctx context.Context, repository, tag string) (DockerImageDigest, error)

GetDigestCached mocks base method

func (*MockClient) GetToken

func (m *MockClient) GetToken(ctx context.Context, repository string) (DockerHubToken, error)

GetToken mocks base method

type MockClientMockRecorder

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

MockClientMockRecorder is the mock recorder for MockClient

func (*MockClientMockRecorder) GetDigest

func (mr *MockClientMockRecorder) GetDigest(ctx, token, repository, tag interface{}) *gomock.Call

GetDigest indicates an expected call of GetDigest

func (*MockClientMockRecorder) GetDigestCached

func (mr *MockClientMockRecorder) GetDigestCached(ctx, repository, tag interface{}) *gomock.Call

GetDigestCached indicates an expected call of GetDigestCached

func (*MockClientMockRecorder) GetToken

func (mr *MockClientMockRecorder) GetToken(ctx, repository interface{}) *gomock.Call

GetToken indicates an expected call of GetToken

Jump to

Keyboard shortcuts

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