credentials

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerConfig

type DockerConfig struct {
	Token     string
	ExpiresAt time.Time
	Hostname  string
}

DockerConfig will hold information required for authentication to registry.

type DockerCredProvider

type DockerCredProvider interface {
	GetDockerCredentials() (DockerConfig, error)
	GetRefreshTime() time.Duration
}

DockerCredProvider defines methods that a docker credentials provider which uses short lived tokens for authentication must implement.

func GetDockerCredentialsProvider

func GetDockerCredentialsProvider(registryLocation string, params Parameters) (DockerCredProvider, error)

GetDockerCredentialsProvider returns an implementation of DockerCredProvider based on the registryLocation

type FakeDockerCredProvider

type FakeDockerCredProvider struct {
	FnGetCreds   func() (DockerConfig, error)
	FnGetRefTime func() time.Duration
}

FakeDockerCredProvider is a mock function that can be swapped in for DockerCredProvider, so you can unit test your code.

func (*FakeDockerCredProvider) GetDockerCredentials

func (f *FakeDockerCredProvider) GetDockerCredentials() (DockerConfig, error)

GetDockerCredentials is the interface definition.

func (*FakeDockerCredProvider) GetRefreshTime

func (f *FakeDockerCredProvider) GetRefreshTime() time.Duration

GetRefreshTime is the interface definition.

type Parameters

type Parameters map[string]interface{}

Jump to

Keyboard shortcuts

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