topiccmdutil

package
v0.51.2-beta1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RetentionMsKey   = "retention.ms"
	RetentionSizeKey = "retention.bytes"
	CleanupPolicy    = "cleanup.policy"
)
View Source
var ValidCleanupPolicies = []string{"delete", "compact", "compact,delete"}

Functions

func ConvertPartitionsToInt

func ConvertPartitionsToInt(partitionStr string) (int32, error)

ConvertPartitionsToInt converts the value from "partitions" to int32

func ConvertRetentionBytesToInt

func ConvertRetentionBytesToInt(retentionBytesStr string) (int, error)

ConvertRetentionBytesToInt converts the value from "retention-bytes" to int

func ConvertRetentionMsToInt

func ConvertRetentionMsToInt(retentionMsStr string) (int, error)

ConvertRetentionMsToInt converts the value from "retention-ms" to int

func CreateConfigEntries

func CreateConfigEntries(entryMap map[string]*string) *[]kafkainstanceclient.ConfigEntry

CreateConfigEntries converts a key value map of config entries to an array of config entries

func GetConfigValue

func GetConfigValue(configEntries []kafkainstanceclient.ConfigEntry, keyName string) (val string)

Types

type Validator

type Validator struct {
	Localizer     localize.Localizer
	InstanceID    string
	Connection    factory.ConnectionFunc
	CurPartitions int
}

Validator is a type for validating Kafka topic configuration values

func (*Validator) ValidateMessageRetentionPeriod

func (v *Validator) ValidateMessageRetentionPeriod(val interface{}) error

ValidateMessageRetentionPeriod validates the value (ms) of the retention period the valid values can range from [-1,...]

func (*Validator) ValidateMessageRetentionSize

func (v *Validator) ValidateMessageRetentionSize(val interface{}) error

ValidateMessageRetentionSize validates the value (bytes) of the retention size the valid values can range from [-1,...]

func (*Validator) ValidateName

func (v *Validator) ValidateName(val interface{}) error

ValidateName validates the name of the topic

func (*Validator) ValidateNameIsAvailable

func (v *Validator) ValidateNameIsAvailable(val interface{}) error

ValidateNameIsAvailable checks if a topic with the given name already exists

func (*Validator) ValidatePartitionsN

func (v *Validator) ValidatePartitionsN(val interface{}) error

ValidatePartitionsN performs validation on the number of partitions v

func (*Validator) ValidateSearchInput

func (v *Validator) ValidateSearchInput(val interface{}) error

Jump to

Keyboard shortcuts

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