registry

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2014 License: Apache-2.0, Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Where we store the config file
	CONFIGFILE = ".dockercfg"

	// Only used for user auth + account creation
	INDEXSERVER    = "https://index.docker.io/v1/"
	REGISTRYSERVER = "https://registry-1.docker.io/v1/"
)

Variables

View Source
var (
	ErrAlreadyExists         = errors.New("Image already exists")
	ErrInvalidRepositoryName = errors.New("Invalid repository name (ex: \"registry.domain.tld/myrepos\")")
	ErrDoesNotExist          = errors.New("Image does not exist")
)
View Source
var (
	ErrConfigFileMissing = errors.New("The Auth config file is missing")
)

Functions

func AddRequiredHeadersToRedirectedRequests

func AddRequiredHeadersToRedirectedRequests(req *http.Request, via []*http.Request) error

func IndexServerAddress

func IndexServerAddress() string

func Login

func Login(authConfig *AuthConfig, factory *utils.HTTPRequestFactory) (string, error)

try to register/login to the registry server

func ResolveRepositoryName

func ResolveRepositoryName(reposName string) (string, string, error)

Resolves a repository name to a hostname + name

func SaveConfig

func SaveConfig(configFile *ConfigFile) error

save the auth config

Types

type AuthConfig

type AuthConfig struct {
	Username      string `json:"username,omitempty"`
	Password      string `json:"password,omitempty"`
	Auth          string `json:"auth"`
	Email         string `json:"email"`
	ServerAddress string `json:"serveraddress,omitempty"`
}

type ConfigFile

type ConfigFile struct {
	Configs map[string]AuthConfig `json:"configs,omitempty"`
	// contains filtered or unexported fields
}

func LoadConfig

func LoadConfig(rootPath string) (*ConfigFile, error)

load up the auth config information and return values FIXME: use the internal golang config parser

func (*ConfigFile) ResolveAuthConfig

func (config *ConfigFile) ResolveAuthConfig(hostname string) AuthConfig

this method matches a auth configuration to a server address or a url

type TimeoutType

type TimeoutType uint32
const (
	NoTimeout TimeoutType = iota
	ReceiveTimeout
	ConnectTimeout
)

Jump to

Keyboard shortcuts

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