Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
 - func ConfigDir() string
 - func SetConfigDir(dir string)
 - type ConfigFile
 - func (configFile *ConfigFile) ContainsAuth() bool
 - func (configFile *ConfigFile) Filename() string
 - func (configFile *ConfigFile) LegacyLoadFromReader(configData io.Reader) error
 - func (configFile *ConfigFile) LoadFromReader(configData io.Reader) error
 - func (configFile *ConfigFile) Save() error
 - func (configFile *ConfigFile) SaveToWriter(writer io.Writer) error
 
Constants ¶
const (
	// ConfigFileName is the name of config file
	ConfigFileName = "config.json"
)
    Variables ¶
This section is empty.
Functions ¶
func ConfigDir ¶ added in v1.8.0
func ConfigDir() string
ConfigDir returns the directory the configuration file is stored in
func SetConfigDir ¶ added in v1.8.0
func SetConfigDir(dir string)
SetConfigDir sets the directory the configuration file is stored in
Types ¶
type ConfigFile ¶
type ConfigFile struct {
	AuthConfigs      map[string]types.AuthConfig `json:"auths"`
	HTTPHeaders      map[string]string           `json:"HttpHeaders,omitempty"`
	PsFormat         string                      `json:"psFormat,omitempty"`
	ImagesFormat     string                      `json:"imagesFormat,omitempty"`
	DetachKeys       string                      `json:"detachKeys,omitempty"`
	CredentialsStore string                      `json:"credsStore,omitempty"`
	// contains filtered or unexported fields
}
    ConfigFile ~/.docker/config.json file info
func LegacyLoadFromReader ¶ added in v1.9.0
func LegacyLoadFromReader(configData io.Reader) (*ConfigFile, error)
LegacyLoadFromReader is a convenience function that creates a ConfigFile object from a non-nested reader
func Load ¶
func Load(configDir string) (*ConfigFile, error)
Load reads the configuration files in the given directory, and sets up the auth config information and return values. FIXME: use the internal golang config parser
func LoadFromReader ¶ added in v1.9.0
func LoadFromReader(configData io.Reader) (*ConfigFile, error)
LoadFromReader is a convenience function that creates a ConfigFile object from a reader
func NewConfigFile ¶
func NewConfigFile(fn string) *ConfigFile
NewConfigFile initializes an empty configuration file for the given filename 'fn'
func (*ConfigFile) ContainsAuth ¶ added in v1.11.0
func (configFile *ConfigFile) ContainsAuth() bool
ContainsAuth returns whether there is authentication configured in this file or not.
func (*ConfigFile) Filename ¶
func (configFile *ConfigFile) Filename() string
Filename returns the name of the configuration file
func (*ConfigFile) LegacyLoadFromReader ¶ added in v1.9.0
func (configFile *ConfigFile) LegacyLoadFromReader(configData io.Reader) error
LegacyLoadFromReader reads the non-nested configuration data given and sets up the auth config information with given directory and populates the receiver object
func (*ConfigFile) LoadFromReader ¶ added in v1.9.0
func (configFile *ConfigFile) LoadFromReader(configData io.Reader) error
LoadFromReader reads the configuration data given and sets up the auth config information with given directory and populates the receiver object
func (*ConfigFile) Save ¶
func (configFile *ConfigFile) Save() error
Save encodes and writes out all the authorization information
func (*ConfigFile) SaveToWriter ¶ added in v1.9.0
func (configFile *ConfigFile) SaveToWriter(writer io.Writer) error
SaveToWriter encodes and writes out all the authorization information to the given writer