github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/objectstorage/v1/swauth/results.go (about)

     1  package swauth
     2  
     3  import (
     4  	"github.com/huaweicloud/golangsdk"
     5  )
     6  
     7  // GetAuthResult contains the response from the Auth request. Call its Extract
     8  // method to interpret it as an AuthResult.
     9  type GetAuthResult struct {
    10  	golangsdk.HeaderResult
    11  }
    12  
    13  // AuthResult contains the authentication information from a Swauth
    14  // authentication request.
    15  type 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.
    23  func (r GetAuthResult) Extract() (*AuthResult, error) {
    24  	var s *AuthResult
    25  	err := r.ExtractInto(&s)
    26  	return s, err
    27  }