config

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2022 License: Apache-2.0 Imports: 5 Imported by: 16

Documentation

Overview

Package config is used for all regclient configuration settings

Index

Constants

View Source
const (
	// DockerRegistry is the name resolved in docker images on Hub
	DockerRegistry = "docker.io"
	// DockerRegistryAuth is the name provided in docker's config for Hub
	DockerRegistryAuth = "https://index.docker.io/v1/"
	// DockerRegistryDNS is the host to connect to for Hub
	DockerRegistryDNS = "registry-1.docker.io"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

type Host struct {
	Name       string            `json:"-"`
	Scheme     string            `json:"scheme,omitempty"` // TODO: deprecate, delete
	TLS        TLSConf           `json:"tls,omitempty"`
	RegCert    string            `json:"regcert,omitempty"`
	ClientCert string            `json:"clientcert,omitempty"`
	ClientKey  string            `json:"clientkey,omitempty"`
	DNS        []string          `json:"dns,omitempty"`      // TODO: remove slice, single string, or remove entirely?
	Hostname   string            `json:"hostname,omitempty"` // replaces DNS array with single string
	User       string            `json:"user,omitempty"`
	Pass       string            `json:"pass,omitempty"`
	Token      string            `json:"token,omitempty"`
	PathPrefix string            `json:"pathPrefix,omitempty"` // used for mirrors defined within a repository namespace
	Mirrors    []string          `json:"mirrors,omitempty"`    // list of other Host Names to use as mirrors
	Priority   uint              `json:"priority,omitempty"`   // priority when sorting mirrors, higher priority attempted first
	RepoAuth   bool              `json:"repoAuth,omitempty"`   // tracks a separate auth per repo
	API        string            `json:"api,omitempty"`        // experimental: registry API to use
	APIOpts    map[string]string `json:"apiOpts,omitempty"`    // options for APIs
	BlobChunk  int64             `json:"blobChunk,omitempty"`  // size of each blob chunk
	BlobMax    int64             `json:"blobMax,omitempty"`    // threshold to switch to chunked upload, -1 to disable, 0 for regclient.blobMaxPut
}

Host struct contains host specific settings

func HostNew

func HostNew() *Host

HostNew creates a default Host entry

func HostNewName

func HostNewName(host string) *Host

HostNewName creates a default Host with a hostname

func (*Host) Merge

func (host *Host) Merge(newHost Host, log *logrus.Logger) error

Merge adds fields from a new config host entry

type TLSConf

type TLSConf int

TLSConf specifies whether TLS is enabled for a host

const (
	// TLSUndefined indicates TLS is not passed, defaults to Enabled
	TLSUndefined TLSConf = iota
	// TLSEnabled uses TLS (https) for the connection
	TLSEnabled
	// TLSInsecure uses TLS but does not verify CA
	TLSInsecure
	// TLSDisabled does not use TLS (http)
	TLSDisabled
)

func (TLSConf) MarshalJSON

func (t TLSConf) MarshalJSON() ([]byte, error)

MarshalJSON converts to a json string using MarshalText

func (TLSConf) MarshalText

func (t TLSConf) MarshalText() ([]byte, error)

MarshalText converts TLSConf to a string

func (*TLSConf) UnmarshalJSON

func (t *TLSConf) UnmarshalJSON(b []byte) error

UnmarshalJSON converts TLSConf from a json string

func (*TLSConf) UnmarshalText

func (t *TLSConf) UnmarshalText(b []byte) error

UnmarshalText converts TLSConf from a string

Jump to

Keyboard shortcuts

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