Documentation ¶
Index ¶
- type ConfigParam
- type CreateOps
- type CreateOpsBuilder
- type CreateResponse
- type CreateResult
- type DeleteResponse
- type DeleteResult
- type GetResult
- type ListResponse
- type ListResult
- type Partition
- type Replica
- type Topic
- type TopicDetail
- type UpdateItem
- type UpdateOpts
- type UpdateOptsBuilder
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigParam ¶
type CreateOps ¶
type CreateOps struct { // the name/ID of a topic Name string `json:"id" required:"true"` // topic partitions, value range: 1-100 Partition int `json:"partition,omitempty"` // topic replications, value range: 1-3 Replication int `json:"replication,omitempty"` // aging time in hours, value range: 1-168, defaults to 72 RetentionTime int `json:"retention_time,omitempty"` SyncMessageFlush bool `json:"sync_message_flush,omitempty"` SyncReplication bool `json:"sync_replication,omitempty"` Description string `json:"topic_desc,omitempty"` Configs []ConfigParam `json:"topic_other_configs,omitempty"` }
CreateOps is a struct that contains all the parameters of create function
func (CreateOps) ToTopicCreateMap ¶
ToTopicCreateMap is used for type convert
type CreateOpsBuilder ¶
CreateOpsBuilder is an interface which is used for creating a kafka topic
type CreateResponse ¶
type CreateResponse struct {
Name string `json:"name"`
}
CreateResponse is a struct that contains the create response
type CreateResult ¶
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 ¶
DeleteResponse is a struct that contains the deletion response
type DeleteResult ¶
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 GetResult ¶
GetResult is a struct which contains the result of query
func Get ¶
func Get(client *golangsdk.ServiceClient, instanceID, topicName string) (r GetResult)
Get an topic with detailed information by instance id and topic name
func (GetResult) Extract ¶
func (r GetResult) Extract() (*TopicDetail, error)
Extract from GetResult
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 ¶
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
type Partition ¶
type Partition struct { Partition int `json:"partition"` Replicas []Replica `json:"replicas"` // Node ID Leader int `json:"leader"` // Log End Offset Leo int `json:"leo"` // High Watermark Hw int `json:"hw"` // Log Start Offset Lso int `json:"lso"` // time stamp UpdateTimestamp int64 `json:"last_update_timestamp"` }
Partition represents the details of a partition
type Replica ¶
type Replica struct { Broker int `json:"broker"` Leader bool `json:"leader"` InSync bool `json:"in_sync"` Size int `json:"size"` Lag int `json:"lag"` }
Replica represents the details of a replica
type Topic ¶
type Topic struct { Name string `json:"name"` Partition int `json:"partition"` Replication int `json:"replication"` RetentionTime int `json:"retention_time"` SyncReplication bool `json:"sync_replication"` SyncMessageFlush bool `json:"sync_message_flush"` TopicType int `json:"topic_type"` PoliciesOnly bool `json:"policiesOnly"` ExternalConfigs interface{} `json:"external_configs"` CreatedAt int64 `json:"created_at"` Description string `json:"topic_desc"` Configs []ConfigParam `json:"topic_other_configs"` }
Topic includes the parameters of an topic
type TopicDetail ¶
type TopicDetail struct { Name string `json:"topic"` Partitions []Partition `json:"partitions"` GroupSubscribed []string `json:"group_subscribed"` }
TopicDetail includes the detail parameters of an topic
type UpdateItem ¶
type UpdateItem struct { // Name can not be updated Name string `json:"id" required:"true"` Partition *int `json:"new_partition_numbers,omitempty"` NewPartitionBrokers []int `json:"new_partition_brokers,omitempty"` RetentionTime *int `json:"retention_time,omitempty"` SyncMessageFlush *bool `json:"sync_message_flush,omitempty"` SyncReplication *bool `json:"sync_replication,omitempty"` Description *string `json:"topic_desc,omitempty"` Configs []ConfigParam `json:"topic_other_configs,omitempty"` }
UpdateItem represents the object of one topic in update function
type UpdateOpts ¶
type UpdateOpts struct {
Topics []UpdateItem `json:"topics" required:"true"`
}
UpdateOpts is a struct which represents the parameters of update function
func (UpdateOpts) ToTopicUpdateMap ¶
func (opts UpdateOpts) ToTopicUpdateMap() (map[string]interface{}, error)
ToTopicUpdateMap is used for type convert
type UpdateOptsBuilder ¶
UpdateOptsBuilder is an interface which can build the map paramter of update function
type UpdateResult ¶
UpdateResult is a struct from which can get the result of update method
func Update ¶
func Update(client *golangsdk.ServiceClient, instanceID string, opts UpdateOptsBuilder) (r UpdateResult)
Update is a method which can be able to update topics