topics

package
v0.0.0-...-d823fe1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: Apache-2.0 Imports: 1 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RequestOpts golangsdk.RequestOpts = golangsdk.RequestOpts{
	MoreHeaders: map[string]string{"Content-Type": "application/json", "X-Language": "en-us"},
}

Functions

This section is empty.

Types

type CreateOps

type CreateOps struct {
	//Name of the topic to be created
	Name string `json:"name" required:"true"`

	//Topic display name
	DisplayName string `json:"display_name,omitempty"`

	EnterpriseProjectId string `json:"enterprise_project_id,omitempty"`
}

CreateOps is a struct that contains all the parameters.

func (CreateOps) ToTopicCreateMap

func (ops CreateOps) ToTopicCreateMap() (map[string]interface{}, error)

type CreateOpsBuilder

type CreateOpsBuilder interface {
	ToTopicCreateMap() (map[string]interface{}, error)
}

CreateOpsBuilder is used for creating topic parameters. any struct providing the parameters should implement this interface

type CreateResult

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

CreateResult contains the response body and error from a Create request.

func Create

func Create(client *golangsdk.ServiceClient, ops CreateOpsBuilder) (r CreateResult)

Create a topic with given parameters.

func (CreateResult) Extract

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

Extract will get the topic object out of the commonResult object.

func (CreateResult) ExtractGet

func (r CreateResult) ExtractGet() (*TopicGet, error)

func (CreateResult) ExtractInto

func (r CreateResult) ExtractInto(v interface{}) error

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

func Delete

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

delete a topic via id

type GetResult

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

func Get

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

get a topic with detailed information by id

func (GetResult) Extract

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

Extract will get the topic object out of the commonResult object.

func (GetResult) ExtractGet

func (r GetResult) ExtractGet() (*TopicGet, error)

func (GetResult) ExtractInto

func (r GetResult) ExtractInto(v interface{}) error

type ListResult

type ListResult struct {
	golangsdk.Result
}

func List

func List(client *golangsdk.ServiceClient) (r ListResult)

list all the topics

func (ListResult) Extract

func (lr ListResult) Extract() ([]TopicGet, error)

type Topic

type Topic struct {
	RequestId string `json:"request_id"`
	TopicUrn  string `json:"topic_urn"`
}

type TopicGet

type TopicGet struct {
	TopicUrn            string `json:"topic_urn"`
	DisplayName         string `json:"display_name"`
	Name                string `json:"name"`
	PushPolicy          int    `json:"push_policy"`
	UpdateTime          string `json:"update_time"`
	CreateTime          string `json:"create_time"`
	EnterpriseProjectId string `json:"enterprise_project_id"`
}

type UpdateOps

type UpdateOps struct {
	//Topic display name
	DisplayName string `json:"display_name,omitempty"`
}

UpdateOps is a struct that contains all the parameters.

func (UpdateOps) ToTopicUpdateMap

func (ops UpdateOps) ToTopicUpdateMap() (map[string]interface{}, error)

type UpdateOpsBuilder

type UpdateOpsBuilder interface {
	ToTopicUpdateMap() (map[string]interface{}, error)
}

CreateOpsBuilder is used for updating topic parameters. any struct providing the parameters should implement this interface

type UpdateResult

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

func Update

func Update(client *golangsdk.ServiceClient, ops UpdateOpsBuilder, id string) (r UpdateResult)

Update a topic with given parameters.

func (UpdateResult) Extract

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

Extract will get the topic object out of the commonResult object.

func (UpdateResult) ExtractGet

func (r UpdateResult) ExtractGet() (*TopicGet, error)

func (UpdateResult) ExtractInto

func (r UpdateResult) ExtractInto(v interface{}) error

Jump to

Keyboard shortcuts

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