topics

package
v0.0.0-...-57791d6 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package topics is only used by terraform-provider-flexibleengine with DmsV1Client to manage flexibleengine_dms_kafka_topic resource.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateOps

type CreateOps struct {
	// the name/ID of a topic
	Name string `json:"id" required:"true"`
	// topic partitions, value range: 1-50, Default value:3
	Partition int `json:"partition,omitempty"`
	// topic replications, value range: 1-3, Default value:3
	Replication int `json:"replication,omitempty"`
	// aging time in hours, value range: 1-168, , Default value:72
	RetentionTime int `json:"retention_time,omitempty"`

	SyncMessageFlush bool `json:"sync_message_flush,omitempty"`
	SyncReplication  bool `json:"sync_replication,omitempty"`
}

CreateOps is a struct that contains all the parameters of create function

func (CreateOps) ToTopicCreateMap

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

ToTopicCreateMap is used for type convert

type CreateOpsBuilder

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

CreateOpsBuilder is an interface which is used for creating a kafka topic

type CreateResponse

type CreateResponse struct {
	Name string `json:"id"`
}

CreateResponse is a struct that contains the create response

type CreateResult

type CreateResult struct {
	golangsdk.Result
}

CreateResult is a struct that contains all the return parameters of creation

func Create

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

Create a kafka topic with given parameters

func (CreateResult) Extract

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

Extract from CreateResult

type DeleteResponse

type DeleteResponse struct {
	Name    string `json:"id"`
	Success bool   `json:"success"`
}

DeleteResponse is a struct that contains the deletion response

type DeleteResult

type DeleteResult struct {
	golangsdk.Result
}

DeleteResult is a struct which contains the result of deletion

func Delete

func Delete(client *golangsdk.ServiceClient, instanceID string, topics []string) (r DeleteResult)

Delete given topics belong to the instance id

func (DeleteResult) Extract

func (r DeleteResult) Extract() ([]DeleteResponse, error)

Extract from DeleteResult

type ListResponse

type ListResponse struct {
	Total            int     `json:"total"`
	Size             int     `json:"size"`
	RemainPartitions int     `json:"remain_partitions"`
	MaxPartitions    int     `json:"max_partitions"`
	Topics           []Topic `json:"topics"`
}

ListResponse is a struct that contains the list response

type ListResult

type ListResult struct {
	golangsdk.Result
}

ListResult contains the body of getting detailed

func List

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

List all topics belong to the instance id

func (ListResult) Extract

func (r ListResult) Extract() ([]Topic, error)

Extract from ListResult

type Topic

type Topic struct {
	Name             string `json:"id"`
	Partition        int    `json:"partition"`
	Replication      int    `json:"replication"`
	RetentionTime    int    `json:"retention_time"`
	TopicType        int    `json:"topic_type"`
	PoliciesOnly     bool   `json:"policiesOnly"`
	SyncReplication  bool   `json:"-"`
	SyncMessageFlush bool   `json:"-"`
}

Topic includes the parameters of an topic

func (*Topic) UnmarshalJSON

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

UnmarshalJSON to override default

Jump to

Keyboard shortcuts

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