docker

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2025 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidRegistry = errors.New("no registry for repo")

Functions

func Handler

func Handler(registries Registries) http.HandlerFunc

func Routes

func Routes(r chi.Router, conf config.Docker) error

Types

type AuthMethod

type AuthMethod uint8
const (
	AuthNone AuthMethod = iota
	AuthToken
	AuthApp
)

type DockerHub

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

func NewDockerHub

func NewDockerHub(conf config.DockerHub) (*DockerHub, error)

func (DockerHub) Authenticator

func (d DockerHub) Authenticator(_ context.Context, _ string) (authn.Authenticator, error)

func (DockerHub) GetOwner

func (d DockerHub) GetOwner(repo string) string

func (DockerHub) GetRepoURL

func (d DockerHub) GetRepoURL(repo string) *url.URL

func (DockerHub) GetTagURL

func (d DockerHub) GetTagURL(repo, tag string) *url.URL

func (DockerHub) Match

func (d DockerHub) Match(repo string) bool

type GHCR added in v1.6.1

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

func NewGhcr

func NewGhcr(conf config.GHCR) (*GHCR, error)

func (*GHCR) Authenticator added in v1.6.1

func (g *GHCR) Authenticator(ctx context.Context, _ string) (authn.Authenticator, error)

func (*GHCR) GetOwner added in v1.6.1

func (g *GHCR) GetOwner(repo string) string

func (*GHCR) GetRepoURL added in v1.6.1

func (g *GHCR) GetRepoURL(repo string) *url.URL

func (*GHCR) GetTagURL added in v1.6.1

func (g *GHCR) GetTagURL(repo, _ string) *url.URL

func (*GHCR) Match added in v1.6.1

func (g *GHCR) Match(repo string) bool

func (*GHCR) RefreshAppToken added in v1.6.1

func (g *GHCR) RefreshAppToken(ctx context.Context) error

type Registries

type Registries []Registry

func NewRegistries

func NewRegistries(conf config.Docker) (Registries, error)

func (Registries) Find

func (r Registries) Find(repo string) (Registry, error)

type Registry

type Registry interface {
	Match(repo string) bool

	Authenticator(ctx context.Context, repo string) (authn.Authenticator, error)

	GetRepoURL(repo string) *url.URL
	GetTagURL(repo, tag string) *url.URL
	GetOwner(repo string) string
}

Jump to

Keyboard shortcuts

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