users

package
v0.1.0-rc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2015 License: Apache-2.0, Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func ListRoles

func ListRoles(client *gophercloud.ServiceClient, tenantID, userID string) pagination.Pager

func MockListUserResponse

func MockListUserResponse(t *testing.T)

func ResourceURL

func ResourceURL(c *gophercloud.ServiceClient, id string) string

Types

type CommonOpts

type CommonOpts struct {
	// Either a name or username is required. When provided, the value must be
	// unique or a 409 conflict error will be returned. If you provide a name but
	// omit a username, the latter will be set to the former; and vice versa.
	Name, Username string

	// The ID of the tenant to which you want to assign this user.
	TenantID string

	// Indicates whether this user is enabled or not.
	Enabled EnabledState

	// The email address of this user.
	Email string
}

CommonOpts are the parameters that are shared between CreateOpts and UpdateOpts

type CreateOpts

type CreateOpts CommonOpts

CreateOpts represents the options needed when creating new users.

func (CreateOpts) ToUserCreateMap

func (opts CreateOpts) ToUserCreateMap() (map[string]interface{}, error)

ToUserCreateMap assembles a request body based on the contents of a CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToUserCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder describes struct types that can be accepted by the Create call.

type CreateResult

type CreateResult struct {
	// contains filtered or unexported fields
}

CreateResult represents the result of a Create operation

func Create

Create is the operation responsible for creating new users.

func (CreateResult) Extract

func (r CreateResult) Extract() (*User, error)

Extract interprets any commonResult as a User, if possible.

type DeleteResult

type DeleteResult struct {
	// contains filtered or unexported fields
}

DeleteResult represents the result of a Delete operation

func Delete

func Delete(client *gophercloud.ServiceClient, id string) DeleteResult

Delete is the operation responsible for permanently deleting an API user.

func (DeleteResult) Extract

func (r DeleteResult) Extract() (*User, error)

Extract interprets any commonResult as a User, if possible.

type EnabledState

type EnabledState *bool

EnabledState represents whether the user is enabled or not.

var (
	Enabled  EnabledState = &iTrue
	Disabled EnabledState = &iFalse
)

Useful variables to use when creating or updating users.

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

GetResult represents the result of a Get operation

func Get

func Get(client *gophercloud.ServiceClient, id string) GetResult

Get requests details on a single user, either by ID.

func (GetResult) Extract

func (r GetResult) Extract() (*User, error)

Extract interprets any commonResult as a User, if possible.

type Role

type Role struct {
	// UUID of the role
	ID string

	// Name of the role
	Name string
}

Role assigns specific responsibilities to users, allowing them to accomplish certain API operations whilst scoped to a service.

func ExtractRoles

func ExtractRoles(page pagination.Page) ([]Role, error)

ExtractRoles returns a slice of Roles contained in a single page of results.

type RolePage

type RolePage struct {
	pagination.SinglePageBase
}

RolePage is a single page of a user Role collection.

func (RolePage) IsEmpty

func (page RolePage) IsEmpty() (bool, error)

IsEmpty determines whether or not a page of Tenants contains any results.

type UpdateOpts

type UpdateOpts CommonOpts

UpdateOpts specifies the base attributes that may be updated on an existing server.

func (UpdateOpts) ToUserUpdateMap

func (opts UpdateOpts) ToUserUpdateMap() map[string]interface{}

ToUserUpdateMap formats an UpdateOpts structure into a request body.

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToUserUpdateMap() map[string]interface{}
}

UpdateOptsBuilder allows extensions to add additional attributes to the Update request.

type UpdateResult

type UpdateResult struct {
	// contains filtered or unexported fields
}

UpdateResult represents the result of an Update operation

func Update

Update is the operation responsible for updating exist users by their UUID.

func (UpdateResult) Extract

func (r UpdateResult) Extract() (*User, error)

Extract interprets any commonResult as a User, if possible.

type User

type User struct {
	// The UUID for this user.
	ID string

	// The human name for this user.
	Name string

	// The username for this user.
	Username string

	// Indicates whether the user is enabled (true) or disabled (false).
	Enabled bool

	// The email address for this user.
	Email string

	// The ID of the tenant to which this user belongs.
	TenantID string `mapstructure:"tenant_id"`
}

User represents a user resource that exists on the API.

func ExtractUsers

func ExtractUsers(page pagination.Page) ([]User, error)

ExtractUsers returns a slice of Tenants contained in a single page of results.

type UserPage

type UserPage struct {
	pagination.SinglePageBase
}

UserPage is a single page of a User collection.

func (UserPage) IsEmpty

func (page UserPage) IsEmpty() (bool, error)

IsEmpty determines whether or not a page of Tenants contains any results.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL