blob: 294c43c07ccb42510d27fc7b96e5aa68df6d79a7 [file] [log] [blame]
Joe Topjian7a0f3e52016-08-22 20:26:34 -06001package swauth
2
3import (
4 "github.com/gophercloud/gophercloud"
5)
6
7// GetAuthResult temporarily contains the response from a Swauth
8// authentication call.
9type GetAuthResult struct {
10 gophercloud.HeaderResult
11}
12
13// AuthResult contains the authentication information from a Swauth
14// authentication request.
15type AuthResult struct {
16 Token string `json:"X-Auth-Token"`
17 StorageURL string `json:"X-Storage-Url"`
18 CDNURL string `json:"X-CDN-Management-Url"`
19}
20
21// Extract is a method that attempts to interpret any Swauth authentication
22// response as a AuthResult struct.
23func (r GetAuthResult) Extract() (*AuthResult, error) {
24 var s *AuthResult
25 err := r.ExtractInto(&s)
26 return s, err
27}