registry

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DHIRegistry = "dhi.io"

DHIRegistry is the Docker Hardened Images registry

View Source
const DockerHubRegistry = "https://index.docker.io/v1/"

DockerHubRegistry is the Docker Hub registry URL

Variables

This section is empty.

Functions

func FormatDHICheck

func FormatDHICheck(info *RegistryInfo) string

FormatDHICheck formats DHI check result for display

func FormatList

func FormatList(registries []RegistryInfo) string

FormatList formats the registry list for display

func FormatStatus

func FormatStatus(info *RegistryInfo) string

FormatStatus formats a single registry status for display

Types

type AuthEntry

type AuthEntry struct {
	Auth string `json:"auth,omitempty"`
}

AuthEntry represents an auth entry in Docker config

type Credentials

type Credentials struct {
	Username string `json:"Username"`
	Secret   string `json:"Secret"`
}

Credentials holds username and password/token

type DockerConfig

type DockerConfig struct {
	Auths      map[string]AuthEntry `json:"auths"`
	CredsStore string               `json:"credsStore,omitempty"`
}

DockerConfig represents the Docker config.json structure

type Manager

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

Manager handles registry operations

func NewManager

func NewManager() *Manager

NewManager creates a new registry manager

func (*Manager) CheckDHI

func (m *Manager) CheckDHI() (*RegistryInfo, error)

CheckDHI verifies if DHI (dhi.io) is properly configured

func (*Manager) GetDockerHubCredentials

func (m *Manager) GetDockerHubCredentials() *Credentials

GetDockerHubCredentials returns Docker Hub credentials if available

func (*Manager) IsDHIReady

func (m *Manager) IsDHIReady() bool

IsDHIReady returns true if DHI is authenticated

func (*Manager) List

func (m *Manager) List() ([]RegistryInfo, error)

List returns all configured registries

func (*Manager) Login

func (m *Manager) Login(registryName string) error

Login wraps docker login command For DHI (dhi.io), it automatically reuses Docker Hub credentials if available

func (*Manager) Logout

func (m *Manager) Logout(registryName string) error

Logout wraps docker logout command

func (*Manager) Status

func (m *Manager) Status(registryName string) (*RegistryInfo, error)

Status checks the authentication status for a specific registry

type RegistryInfo

type RegistryInfo struct {
	Name          string
	Authenticated bool
	Username      string
	CredsHelper   string // e.g., "desktop", "pass", "secretservice"
}

RegistryInfo contains information about a configured registry

Jump to

Keyboard shortcuts

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