code: func (c *AuthConfig) encode() (string, error) {
  	var buf bytes.Buffer
  	if err := json.NewEncoder(&buf).Encode(c); err != nil {
  		return "", err
  	}
  	return base64.URLEncoding.EncodeToString(buf.Bytes()), nil
  }
docs: // encode the auth configuration struct into base64 for the X-Registry-Auth header