custom

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SidecarHost     = "localhost"      // The Host name used when making requests to the K8S sidecar.
	SidecarPort     = "8888"           // The HTTP port on which the sidecar must be listening for POST / DELETE requests.
	TopicsPath      = "/topics"        // The HTTP request path for Kafka Topic creation / deletion to be implemented by the sidecar.
	TopicNameHeader = "Slug"           // The HTTP Header key used to identify the TopicName in the POST request.
	SidecarTimeout  = 30 * time.Second // How long to wait for the sidecar's server to respond.
)

Custom REST Sidecar Constants

NOTE - These are expected to be used by third-party implementers of

custom sidecars, do not remove due to "unused" status in IDE!

Variables

This section is empty.

Functions

func NewAdminClient added in v0.20.0

func NewAdminClient(ctx context.Context) (types.AdminClientInterface, error)

Create A New Custom Kafka AdminClient Based On The Kafka Secret In The Specified K8S Namespace

Types

type CustomAdminClient added in v0.20.0

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

Custom AdminClient Definition

func (*CustomAdminClient) Close added in v0.20.0

func (c *CustomAdminClient) Close() error

Custom REST Pass-Through Function For Closing The Admin Client

func (*CustomAdminClient) CreateTopic added in v0.20.0

func (c *CustomAdminClient) CreateTopic(_ context.Context, topicName string, topicDetail *sarama.TopicDetail) *sarama.TopicError

Custom REST Pass-Through Function For Creating Topics

func (*CustomAdminClient) DeleteTopic added in v0.20.0

func (c *CustomAdminClient) DeleteTopic(_ context.Context, topicName string) *sarama.TopicError

Custom REST Pass-Through Function For Deleting Topics

type TopicDetail

type TopicDetail struct {
	NumPartitions     int32              `json:"numPartitions"`
	ReplicationFactor int16              `json:"replicationFactor"`
	ReplicaAssignment map[int32][]int32  `json:"replicaAssignment,omitempty"`
	ConfigEntries     map[string]*string `json:"configEntries,omitempty"`
}

Custom TopicDetail Struct

func NewTopicDetail

func NewTopicDetail(numPartitions int32, replicationFactor int16, replicaAssignment map[int32][]int32, configEntries map[string]*string) *TopicDetail

Custom TopicDetail Constructor

func (*TopicDetail) FromSaramaTopicDetail

func (c *TopicDetail) FromSaramaTopicDetail(topicDetail *sarama.TopicDetail)

Convert A Sarama TopicDetail To The Current Custom TopicDetail

func (*TopicDetail) ToSaramaTopicDetail

func (c *TopicDetail) ToSaramaTopicDetail() *sarama.TopicDetail

Convert The Current Custom TopicDetail To A Sarama TopicDetail

Jump to

Keyboard shortcuts

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