tags

package
v0.0.0-...-63319d1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MPL-2.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionOpts

type ActionOpts struct {
	Action string        `json:"action" required:"ture"`
	Tags   []ResourceTag `json:"tags" required:"true"`
}

ActionOpts is a struct contains the parameters of creating/deleting tags

func (ActionOpts) ToTagsActionMap

func (opts ActionOpts) ToTagsActionMap() (map[string]interface{}, error)

ToTagsActionMap build the action request in json format

type ActionOptsBuilder

type ActionOptsBuilder interface {
	ToTagsActionMap() (map[string]interface{}, error)
}

ActionOptsBuilder is an interface from which can build the request of creating/deleting tags

type ActionResult

type ActionResult struct {
	golangsdk.ErrResult
}

ActionResult is the action result which is the result of create or delete operations

func Create

func Create(client *golangsdk.ServiceClient, srvType, id string, tags []ResourceTag) (r ActionResult)

Create is a method of creating tags by id

func Delete

func Delete(client *golangsdk.ServiceClient, srvType, id string, tags []ResourceTag) (r ActionResult)

Delete is a method of deleting tags by id

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

func DeleteWithKey

func DeleteWithKey(client *golangsdk.ServiceClient, srvType, id, key string) (r DeleteResult)

DeleteWithKey is a method of deleting tags by key

type GetResult

type GetResult struct {
	golangsdk.Result
}

GetResult contains the body of getting detailed tags request

func Get

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

Get is a method of getting the tags by id

func (GetResult) Extract

func (r GetResult) Extract() (ResourceTags, error)

Extract method will parse the result body into ResourceTags struct

type ListResult

type ListResult struct {
	golangsdk.Result
}

ListResult contains the body of getting all tags request

func List

func List(client *golangsdk.ServiceClient, srvType string) (r ListResult)

List is a method of getting the tags of all service

func (ListResult) Extract

func (r ListResult) Extract() (ResourceTags, error)

Extract method will parse the result body into ResourceTags struct

type ResourceTag

type ResourceTag struct {
	Key   string `json:"key" required:"ture"`
	Value string `json:"value,omitempty"`
}

ResourceTag is in key-value format

type ResourceTags

type ResourceTags struct {
	Tags []ResourceTag `json:"tags"`
}

ResourceTags represents the tags response

Jump to

Keyboard shortcuts

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