attributes

package
v0.0.0-...-d74374d Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractAttributes

func ExtractAttributes(r pagination.Page) ([]string, error)

ExtractAttributes accepts a Page struct, specifically an AttributePage struct, and extracts the elements into a slice of Attribute structs. In other words, a generic collection is mapped into a relevant slice.

func ExtractAttributesInto

func ExtractAttributesInto(r pagination.Page, v interface{}) error

func List

List retrieves a list of Attributes.

Types

type AttributePage

type AttributePage struct {
	pagination.SinglePageBase
}

AttributePage is a single page of attributes results.

func (AttributePage) IsEmpty

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

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

func (AttributePage) NextPageURL

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

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

type ListOpts

type ListOpts struct {
	MaxDepth  int    `q:"max_depth"`
	Limit     int    `q:"limit"`
	DomainID  string `q:"domain_id"`
	ProjectID string `q:"project_id"`
}

ListOpts allows the filtering of paginated collections through the API. Filtering is achieved by passing in filter value. Page and PerPage are used for pagination.

func (ListOpts) ToAttributeListQuery

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

ToAttributeListQuery formats a ListOpts into a query string.

type ListOptsBuilder

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

ListOptsBuilder allows extensions to add additional parameters to the List request.

Jump to

Keyboard shortcuts

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