File: results.go

package info (click to toggle)
golang-github-gophercloud-gophercloud 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,416 kB
  • sloc: sh: 99; makefile: 21
file content (27 lines) | stat: -rw-r--r-- 731 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package swauth

import (
	"github.com/gophercloud/gophercloud"
)

// GetAuthResult contains the response from the Auth request. Call its Extract
// method to interpret it as an AuthResult.
type GetAuthResult struct {
	gophercloud.HeaderResult
}

// AuthResult contains the authentication information from a Swauth
// authentication request.
type AuthResult struct {
	Token      string `json:"X-Auth-Token"`
	StorageURL string `json:"X-Storage-Url"`
	CDNURL     string `json:"X-CDN-Management-Url"`
}

// Extract is a method that attempts to interpret any Swauth authentication
// response as a AuthResult struct.
func (r GetAuthResult) Extract() (*AuthResult, error) {
	var s *AuthResult
	err := r.ExtractInto(&s)
	return s, err
}