topic

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrUnknownTopic = "unknown topic"
	ErrInvalidInput = "input given may be invalid like empty topic name or so"
)

Errors

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Config Config
}

Client is a struct for service account client

func (*Client) TopicCreate

func (c *Client) TopicCreate(tp v1alpha1.TopicParameters) error

TopicCreate Executes Confluent CLI command to create a Topic in Confluent Cloud

func (*Client) TopicDelete

func (c *Client) TopicDelete(tp v1alpha1.TopicParameters) error

TopicDelete Executes Confluent CLI command, and with its given TopicParameters, attempts to delete a Topic in Confluent Cloud

func (*Client) TopicDescribe

func (c *Client) TopicDescribe(to v1alpha1.TopicObservation) (DescribeResponse, error)

TopicDescribe Executes Confluent CLI command to retrieve metadata about a Topic from Confluent Cloud

func (*Client) TopicUpdate

func (c *Client) TopicUpdate(tp v1alpha1.TopicParameters) error

TopicUpdate Executes Confluent CLI command, and with its given TopicParameters, attempts to update a Topic in Confluent Cloud

type Config

type Config struct {
	APICredentials clients.APICredentials
}

Config is a configuration element for the service account client

type DescribeResponse

type DescribeResponse struct {
	TopicName string `json:"topic_name"`
	Config    struct {
		CleanupPolicy                        string `json:"cleanup.policy"`
		CompressionType                      string `json:"compression.type"`
		DeleteRetentionMs                    string `json:"delete.retention.ms"`
		FileDeleteDelayMs                    string `json:"file.delete.delay.ms"`
		FlushMessages                        string `json:"flush.messages"`
		FlushMs                              string `json:"flush.ms"`
		FollowerReplicationThrottledReplicas string `json:"follower.replication.throttled.replicas"`
		IndexIntervalBytes                   string `json:"index.interval.bytes"`
		LeaderReplicationThrottledReplicas   string `json:"leader.replication.throttled.replicas"`
		MaxCompactionLagMs                   string `json:"max.compaction.lag.ms"`
		MaxMessageBytes                      string `json:"max.message.bytes"`
		MessageDownconversionEnable          string `json:"message.downconversion.enable"`
		MessageFormatVersion                 string `json:"message.format.version"`
		MessageTimestampDifferenceMaxMs      string `json:"message.timestamp.difference.max.ms"`
		MessageTimestampType                 string `json:"message.timestamp.type"`
		MinCleanableDirtyRatio               string `json:"min.cleanable.dirty.ratio"`
		MinCompactionLagMs                   string `json:"min.compaction.lag.ms"`
		MinInsyncReplicas                    string `json:"min.insync.replicas"`
		NumPartitions                        string `json:"num.partitions"`
		Preallocate                          string `json:"preallocate"`
		RetentionBytes                       string `json:"retention.bytes"`
		RetentionMs                          string `json:"retention.ms"`
		SegmentBytes                         string `json:"segment.bytes"`
		SegmentIndexBytes                    string `json:"segment.index.bytes"`
		SegmentJitterMs                      string `json:"segment.jitter.ms"`
		SegmentMs                            string `json:"segment.ms"`
		UncleanLeaderElectionEnable          string `json:"unclean.leader.election.enable"`
	} `json:"config"`
}

DescribeResponse is a struct used for deserialising the response of TopicDescribe

type IClient

type IClient interface {
	TopicCreate(tp v1alpha1.TopicParameters) error
	TopicDelete(tp v1alpha1.TopicParameters) error
	TopicDescribe(to v1alpha1.TopicObservation) (DescribeResponse, error)
	TopicUpdate(tp v1alpha1.TopicParameters) error
}

IClient interface for service account client

func NewClient

func NewClient(c Config) IClient

NewClient is a factory method for apikey client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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