groups

package
v0.0.0-...-8db8df1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package groups manages and retrieves Groups in the OpenStack Identity Service.

Example to List Groups

listOpts := groups.ListOpts{
	DomainID: "default",
}

allPages, err := groups.List(identityClient, listOpts).AllPages()
if err != nil {
	panic(err)
}

allGroups, err := groups.ExtractGroups(allPages)
if err != nil {
	panic(err)
}

for _, group := range allGroups {
	fmt.Printf("%+v\n", group)
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

List enumerates the Groups to which the current token has access.

Types

type GetResult

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

GetResult is the response from a Get operation. Call its Extract method to interpret it as a Group.

func Get

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

Get retrieves details on a single group, by ID.

func (GetResult) Extract

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

Extract interprets any group results as a Group.

type Group

type Group struct {
	// Description describes the group purpose.
	Description string `json:"description"`

	// DomainID is the domain ID the group belongs to.
	DomainID string `json:"domain_id"`

	// ID is the unique ID of the group.
	ID string `json:"id"`

	// Extra is a collection of miscellaneous key/values.
	Extra map[string]interface{} `json:"-"`

	// Links contains referencing links to the group.
	Links map[string]interface{} `json:"links"`

	// Name is the name of the group.
	Name string `json:"name"`
}

Group helps manage related users.

func ExtractGroups

func ExtractGroups(r pagination.Page) ([]Group, error)

ExtractGroups returns a slice of Groups contained in a single page of results.

func (*Group) UnmarshalJSON

func (r *Group) UnmarshalJSON(b []byte) error

type GroupPage

type GroupPage struct {
	pagination.LinkedPageBase
}

GroupPage is a single page of Group results.

func (GroupPage) IsEmpty

func (r GroupPage) IsEmpty() (bool, error)

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

func (GroupPage) NextPageURL

func (r GroupPage) NextPageURL() (string, error)

NextPageURL extracts the "next" link from the links section of the result.

type ListOpts

type ListOpts struct {
	// DomainID filters the response by a domain ID.
	DomainID string `q:"domain_id"`

	// Name filters the response by group name.
	Name string `q:"name"`
}

ListOpts provides options to filter the List results.

func (ListOpts) ToGroupListQuery

func (opts ListOpts) ToGroupListQuery() (string, error)

ToGroupListQuery formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToGroupListQuery() (string, error)
}

ListOptsBuilder allows extensions to add additional parameters to the List request

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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