Documentation ¶
Index ¶
- Constants
- Variables
- func AddRequiredHeadersToRedirectedRequests(req *http.Request, via []*http.Request) error
- func IndexServerAddress() string
- func Login(authConfig *AuthConfig, factory *utils.HTTPRequestFactory) (string, error)
- func ResolveRepositoryName(reposName string) (string, string, error)
- func SaveConfig(configFile *ConfigFile) error
- type AuthConfig
- type ConfigFile
- type TimeoutType
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 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 ¶
Resolves a repository name to a hostname + name
Types ¶
type AuthConfig ¶
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 )
Click to show internal directories.
Click to hide internal directories.