func (client *ProviderClient) Token() string {
	if client.mut != nil {
		client.mut.RLock()
		defer client.mut.RUnlock()
	}
	return client.TokenID
}
Token safely reads the value of the auth token from the ProviderClient. Applications should
call this method to access the token instead of the TokenID field
package gophercloud
import (
	"bytes"
	"encoding/json"
	"io"
	"io/ioutil"
	"net/http"
	"strings"
	"sync"
)
const DefaultUserAgent = "gophercloud/2.0.0"
type UserAgent struct {
	prepend []string
}
func (ua *UserAgent) Prepend(s ...string) {
	ua.prepend = append(s, ua.prepend...)
}
func (ua *UserAgent) Join() string {
	uaSlice := append(ua.prepend, DefaultUserAgent)
	return strings.Join(uaSlice, " ")
}
type ProviderClient struct {
	IdentityBase string
	IdentityEndpoint string
	TokenID string
	EndpointLocator EndpointLocator
	HTTPClient http.Client
	UserAgent UserAgent
	ReauthFunc func() error
	mut *sync.RWMutex
	reauthmut *reauthlock
}
type reauthlock struct {
	sync.RWMutex
	reauthing bool
}
func (client *ProviderClient) AuthenticatedHeaders() (m map[string]string) {
	if client.reauthmut != nil {
		client.reauthmut.RLock()
		if client.reauthmut.reauthing {
			client.reauthmut.RUnlock()
			return
		}
		client.reauthmut.RUnlock()
	}
	t := client.Token()
	if t == "" {
		return
	}
	return map[string]string{"X-Auth-Token": t}
}
func (client *ProviderClient) UseTokenLock() {
	client.mut = new(sync.RWMutex)
	client.reauthmut = new(reauthlock)
}