util

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateNumberOfCollector added in v0.2.8

func CalculateNumberOfCollector(topicCount int, maxHostCount int) int

func CheckMCISType added in v0.5.2

func CheckMCISType(serviceType string) bool

func CheckMCK8SType added in v0.5.2

func CheckMCK8SType(serviceType string) bool

func DeploymentTemplate added in v0.4.4

func DeploymentTemplate(collectorCreateOrder int, collectorUUID string, env []apiv1.EnvVar) *appsv1.Deployment

func GetAllTopicBySort added in v0.2.8

func GetAllTopicBySort(topicsSlice []string) []string

func GetCspCollectorIdx added in v0.4.4

func GetCspCollectorIdx(topic string) (collectorIdx int)

func GetFields

func GetFields(val reflect.Value) []string

func GetLogger added in v0.3.5

func GetLogger() *logrus.Logger

func GetMCK8SRingQueue added in v0.5.2

func GetMCK8SRingQueue() *queue.Queue

func GetRingQueue added in v0.4.4

func GetRingQueue() *queue.Queue

func Initialize added in v0.4.4

func Initialize() error

TODO: Broker connection close logic

defer func() {
	if err := kafka.Close(); err != nil {
		panic(err)
	}
}()

func Int32Ptr added in v0.4.4

func Int32Ptr(i int32) *int32

func Int64Ptr added in v0.4.4

func Int64Ptr(i int64) *int64

func MakeCollectorTopicMap added in v0.2.8

func MakeCollectorTopicMap(allTopics []string, maxHostCount int) (map[int][]string, []int)

func MergeTopicsToOneString added in v0.2.8

func MergeTopicsToOneString(topicsSlice []string) string

func PutMCK8SRingQueue added in v0.5.2

func PutMCK8SRingQueue(topicManagePolicy string, topic string) error

func ReturnDiffTopicList added in v0.2.8

func ReturnDiffTopicList(a, b []string) (diff []string)

func RingQueuePut added in v0.4.4

func RingQueuePut(topicManagePolicy string, topic string) error

func RunCommand

func RunCommand(vmIP string, userName string, privateKey string, cmd string) (*string, error)

func SplitOneStringToTopicsSlice added in v0.2.8

func SplitOneStringToTopicsSlice(topicsStrings string) []string

func StructToMap

func StructToMap(i interface{}) (values url.Values)

func ToFixed added in v0.4.4

func ToFixed(num float64, precision int) float64

func ToMap

func ToMap(val interface{}) (map[string]interface{}, error)

func Unique added in v0.4.4

func Unique(slice []string, sortOption bool) []string

Types

type KafkaStruct added in v0.4.4

type KafkaStruct struct {
	AdminClient    *kafka.AdminClient
	ConsumerClient *kafka.Consumer
}

func GetInstance added in v0.4.4

func GetInstance() (*KafkaStruct, error)

type TopicStructure added in v0.4.4

type TopicStructure struct {
	Policy string
	Topic  string
}

Jump to

Keyboard shortcuts

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