package tokens

import "github.com/rackspace/gophercloud/rackspace/identity/v2/tokens"

Package tokens provides information and interaction with the token API resource for the Rackspace Identity service.

Index

Variables

var (
	// ErrPasswordProvided is returned if both a password and an API key are provided to Create.
	ErrPasswordProvided = errors.New("Please provide either a password or an API key.")
)

Functions

func Create

func Create(client *gophercloud.ServiceClient, auth AuthOptions) os.CreateResult

Create authenticates to Rackspace's identity service and attempts to acquire a Token. Rather than interact with this service directly, users should generally call rackspace.AuthenticatedClient().

Types

type AuthOptions

type AuthOptions struct {
	os.AuthOptions
}

AuthOptions wraps the OpenStack AuthOptions struct to be able to customize the request body when API key authentication is used.

func WrapOptions

func WrapOptions(original gophercloud.AuthOptions) AuthOptions

WrapOptions embeds a root AuthOptions struct in a package-specific one.

func (AuthOptions) ToTokenCreateMap

func (auth AuthOptions) ToTokenCreateMap() (map[string]interface{}, error)

ToTokenCreateMap serializes an AuthOptions into a request body. If an API key is provided, it will be used, otherwise

Source Files

delegate.go doc.go

Version
v1.0.0 (latest)
Published
Oct 28, 2014
Platform
linux/amd64
Imports
3 packages
Last checked
1 day ago

Tools for package owners.