Documentation
¶
Index ¶
- func AlterPartitionReassignmentsRequestAssignmentError(results []kafka.AlterPartitionReassignmentsResponsePartitionResult) error
- func CanTestBrokerAdmin() bool
- func CanTestBrokerAdminSecurity() bool
- func CopyInts(input []int) []int
- func DescribeUserScramCredentialsResponseResultsError(results []kafka.DescribeUserScramCredentialsResponseResult) error
- func InTerminal() bool
- func IncrementalAlterConfigsResponseResourcesError(resources []kafka.IncrementalAlterConfigsResponseResource) error
- func KafkaErrorsToErr(errors map[string]error) error
- func PrettyDuration(duration time.Duration) string
- func PrettyRate(count int64, duration time.Duration) string
- func RandomString(prefix string, length int) string
- func RetryUntil(t *testing.T, timeout time.Duration, f func() error)
- func SameElements(slice1 []int, slice2 []int) bool
- func ShowProgress(ctx context.Context, progressConfig interface{}, interval time.Duration, ...)
- func ShuffledKeys(input map[int]int, seedStr string) []int
- func SortedKeys(input map[int]int) []int
- func SortedKeysByValue(input map[int]int, asc bool, keySorter KeySorter) []int
- func StructToStr(inputStruct interface{}) (string, error)
- func TestKafkaAddr() string
- func TestZKAddr() string
- func TruncateStringMiddle(input string, maxLen int, suffixLen int) (string, int)
- func TruncateStringSuffix(input string, maxLen int) (string, int)
- type KeySorter
- type RebalanceCtxStruct
- type RebalanceProgressConfig
- type RebalanceRoundProgressConfig
- type RebalanceTopicProgressConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlterPartitionReassignmentsRequestAssignmentError ¶ added in v1.8.1
func AlterPartitionReassignmentsRequestAssignmentError(results []kafka.AlterPartitionReassignmentsResponsePartitionResult) error
func CanTestBrokerAdmin ¶ added in v1.0.0
func CanTestBrokerAdmin() bool
CanTestBrokerAdmin returns whether we can test the broker-only admin client.
func CanTestBrokerAdminSecurity ¶ added in v1.10.3
func CanTestBrokerAdminSecurity() bool
CanTestBrokerAdminSecurity returns whether we can test the broker-only admin client security features.
func DescribeUserScramCredentialsResponseResultsError ¶ added in v1.10.3
func DescribeUserScramCredentialsResponseResultsError(results []kafka.DescribeUserScramCredentialsResponseResult) error
func InTerminal ¶
func InTerminal() bool
InTerminal determines whether we're running in a terminal or not.
Implementation from https://rosettacode.org/wiki/Check_output_device_is_a_terminal#Go.
func IncrementalAlterConfigsResponseResourcesError ¶ added in v1.7.0
func IncrementalAlterConfigsResponseResourcesError(resources []kafka.IncrementalAlterConfigsResponseResource) error
func KafkaErrorsToErr ¶ added in v1.7.0
func PrettyDuration ¶
PrettyDuration returns a human-formatted duration string given an golang duration value.
func PrettyRate ¶
PrettyRate returns a human-formatted rate from a count and a duration.
func RandomString ¶
RandomString returns a random string with the argument length.
Adapted from the example in https://stackoverflow.com/questions/22892120/how-to-generate-a-random-string-of-a-fixed-length-in-go.
func RetryUntil ¶ added in v1.0.0
RetryUntil is a helper that will re-run the argument function multiple times (up to a duration limit) until it no longer produces an error.
func SameElements ¶
SameElements determines whether two int slices have the same elements (in any order).
func ShowProgress ¶ added in v1.10.1
func ShowProgress( ctx context.Context, progressConfig interface{}, interval time.Duration, stopChan chan bool, )
shows progress of a config repeatedly during an interval
func ShuffledKeys ¶
ShuffledKeys returns a shuffled version of the keys in the argument map. The provided seedStr is hashed and used to seed the random number generator.
func SortedKeys ¶
SortedKeys returns the keys of the argument, sorted by value.
func SortedKeysByValue ¶
SortedKeysByValue returns the keys in a map, sorted by the map values.
func StructToStr ¶ added in v1.10.1
Convert any struct to json string
func TestKafkaAddr ¶
func TestKafkaAddr() string
TestKafkaAddr returns a kafka bootstrap address for unit testing purposes.
func TestZKAddr ¶
func TestZKAddr() string
TestZKAddr returns a zookeeper address for unit testing purposes.
func TruncateStringMiddle ¶
TruncateStringMiddle truncates a string by replacing characters in the middle with "..." if needed.
Types ¶
type KeySorter ¶
KeySorter is a type for a function that sorts integer keys based on their values in a map.
type RebalanceCtxStruct ¶ added in v1.10.1
type RebalanceCtxStruct struct { Enabled bool `json:"enabled"` Interval time.Duration `json:"interval"` }
Rebalance context struct
type RebalanceProgressConfig ¶ added in v1.10.1
type RebalanceProgressConfig struct { SuccessTopics int `json:"success_topics"` ErrorTopics int `json:"error_topics"` ClusterName string `json:"cluster"` ClusterEnvironment string `json:"environment"` ToRemove []int `json:"to_remove"` }
Rebalance overall progress Config
type RebalanceRoundProgressConfig ¶ added in v1.10.1
type RebalanceRoundProgressConfig struct { TopicName string `json:"topic"` ClusterName string `json:"cluster"` ClusterEnvironment string `json:"environment"` ToRemove []int `json:"to_remove"` CurrRound int `json:"round"` TotalRounds int `json:"total_rounds"` }
Rebalance Topic Round progress Config
type RebalanceTopicProgressConfig ¶ added in v1.10.1
type RebalanceTopicProgressConfig struct { TopicName string `json:"topic"` ClusterName string `json:"cluster"` ClusterEnvironment string `json:"environment"` ToRemove []int `json:"to_remove"` RebalanceError bool `json:"rebalance_error"` }
Rebalance topic progress Config