metadata

package
v0.5.27 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractMetadataInto

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

func MetadataItemURL

func MetadataItemURL(c *gcorecloud.ServiceClient, id string, key string) string

func MetadataList

func MetadataList(client *gcorecloud.ServiceClient, id string) pagination.Pager

func MetadataURL

func MetadataURL(c *gcorecloud.ServiceClient, id string) string

func ResourceActionURL

func ResourceActionURL(c *gcorecloud.ServiceClient, id string, action string) string

Types

type Metadata

type Metadata struct {
	Key      string `json:"key"`
	Value    string `json:"value"`
	ReadOnly bool   `json:"read_only"`
}

func ExtractMetadata

func ExtractMetadata(r pagination.Page) ([]Metadata, error)

ExtractMetadata accepts a Page struct, specifically a MetadataPage struct, and extracts the elements into a slice of securitygroups metadata structs. In other words, a generic collection is mapped into a relevant slice.

func MetadataListAll

func MetadataListAll(client *gcorecloud.ServiceClient, id string) ([]Metadata, error)

type MetadataActionResult

type MetadataActionResult struct {
	gcorecloud.ErrResult
}

MetadataActionResult represents the result of a creation, delete or update operation(no content)

func MetadataCreateOrUpdate

func MetadataCreateOrUpdate(client *gcorecloud.ServiceClient, id string, opts map[string]string) (r MetadataActionResult)

MetadataCreateOrUpdate creates or update a metadata for a resource.

func MetadataDelete

func MetadataDelete(client *gcorecloud.ServiceClient, id string, key string) (r MetadataActionResult)

MetadataDelete deletes defined metadata key for a resource.

func MetadataReplace

func MetadataReplace(client *gcorecloud.ServiceClient, id string, opts map[string]string) (r MetadataActionResult)

MetadataReplace replace a metadata for a resource.

type MetadataPage

type MetadataPage struct {
	pagination.LinkedPageBase
}

func (MetadataPage) IsEmpty

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

IsEmpty checks whether a MetadataPage struct is empty.

type MetadataResult

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

MetadataResult represents the result of a get operation

func MetadataGet

func MetadataGet(client *gcorecloud.ServiceClient, id string, key string) (r MetadataResult)

MetadataGet gets defined metadata key for a resource.

func (MetadataResult) Extract

func (r MetadataResult) Extract() (*Metadata, error)

Jump to

Keyboard shortcuts

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