Set-up CircleCI builds

This commit is contained in:
Brian DeHamer 2015-07-15 22:48:49 +00:00
parent c02c4b9ec1
commit 31b6a30686
83 changed files with 18516 additions and 1 deletions

View file

@ -0,0 +1,21 @@
package dockerclient
import (
"bytes"
"encoding/base64"
"encoding/json"
)
// AuthConfig hold parameters for authenticating with the docker registry
type AuthConfig struct {
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Email string `json:"email,omitempty"`
}
// encode the auth configuration struct into base64 for the X-Registry-Auth header
func (c *AuthConfig) encode() string {
var buf bytes.Buffer
json.NewEncoder(&buf).Encode(c)
return base64.URLEncoding.EncodeToString(buf.Bytes())
}