config

package
v0.0.0-...-85536c8 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2016 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConfigFileName is the name of config file
	ConfigFileName = "config.json"
)

Variables

View Source
var KeyAES []byte

Functions

func AESDecrypt

func AESDecrypt(ciphertext, AESKey []byte) ([]byte, error)

AESDecrypt will decrypt the ciphertext via the given key.

func AESEncrypt

func AESEncrypt(message, AESKey []byte) ([]byte, error)

AESEncrypt will encrypt the message with cipher feedback mode with the given key.

func ConfigDir

func ConfigDir() string

func DecodeAuth

func DecodeAuth(authStr string) (string, string, error)

DecodeAuth decodes a base64 encoded string and returns username and password

func InitAESKey

func InitAESKey() (bool, error)

Types

type AuthConfig

type AuthConfig struct {
	Username      string `json:"uername,omitempty"`
	Password      string `json:"password,omitempty"`
	Auth          string `json:"auth"`
	Email         string `json:"email,omitempty"`
	ServerAddress string `json:"serveraddress:,omitempty"`
	IdentityToken string `json:"identitytoken,omitempty"`
	RegistryToken string `json:"registrytoken,omitempty"`
}

AuthConfig contains authorization infomation for connecting to a Registry

type ConfigFile

type ConfigFile struct {
	AuthConfigs      map[string]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 Load

func Load(configDir string) (*ConfigFile, error)

Load reads the configuration files in the given directory

func NewConfigFile

func NewConfigFile(fn string) *ConfigFile

NewConfigFile initilizes am empty configuration file for the given filename 'fn'

func (*ConfigFile) LoadFromReader

func (configFile *ConfigFile) LoadFromReader(configData io.Reader) error

Jump to

Keyboard shortcuts

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