Documentation ¶
Index ¶
- Variables
- func ConvertPartitionsToInt(partitionStr string) (int32, error)
- func ConvertRetentionBytesToInt(retentionBytesStr string) (int, error)
- func ConvertRetentionMsToInt(retentionMsStr string) (int, error)
- func CreateConfigEntries(entryMap map[string]*string) *[]kafkainstanceclient.ConfigEntry
- func GetConfigValue(configEntries []kafkainstanceclient.ConfigEntry, keyName string) (val string)
- type Validator
- func (v *Validator) ValidateMessageRetentionPeriod(val interface{}) error
- func (v *Validator) ValidateMessageRetentionSize(val interface{}) error
- func (v *Validator) ValidateName(val interface{}) error
- func (v *Validator) ValidateNameIsAvailable(val interface{}) error
- func (v *Validator) ValidatePartitionsN(val interface{}) error
- func (v *Validator) ValidateSearchInput(val interface{}) error
Constants ¶
This section is empty.
Variables ¶
var ( RetentionMsKey = "retention.ms" RetentionSizeKey = "retention.bytes" PartitionsKey = "partitions" CleanupPolicy = "cleanup.policy" )
var ValidCleanupPolicies = []string{"delete", "compact", "compact,delete"}
Functions ¶
func ConvertPartitionsToInt ¶
ConvertPartitionsToInt converts the value from "partitions" to int32
func ConvertRetentionBytesToInt ¶
ConvertRetentionBytesToInt converts the value from "retention-bytes" to int
func ConvertRetentionMsToInt ¶
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 ¶
ValidateMessageRetentionPeriod validates the value (ms) of the retention period the valid values can range from [-1,...]
func (*Validator) ValidateMessageRetentionSize ¶
ValidateMessageRetentionSize validates the value (bytes) of the retention size the valid values can range from [-1,...]
func (*Validator) ValidateName ¶
ValidateName validates the name of the topic
func (*Validator) ValidateNameIsAvailable ¶
ValidateNameIsAvailable checks if a topic with the given name already exists
func (*Validator) ValidatePartitionsN ¶
ValidatePartitionsN performs validation on the number of partitions v