Documentation ¶
Index ¶
- Constants
- Variables
- func Hostname() string
- func InitLoggerWithStdOut(loglevel string) *logrus.Logger
- func Int32SliceEquals(a, b []int32) bool
- func StartMetricsCollector(subsystem string)
- func StringInSlice(s string, slce []string) bool
- func StringSliceEquals(a, b []string) bool
- func ValidateTopicInformation(brokers []string, topic string, config *sarama.Config, logger *logrus.Logger) bool
Constants ¶
View Source
const ( // Producer Types (Async) ProducerSync = iota // 0 ProducerAsync // 1 )
View Source
const ( // Defaults DefaultKafkaBrokers = "kafka:9094" // The default kafka brokers as a comma separate list DefaultKafkaVersion = "2.8.1" //The default kafka version DefaultTopic = "trees" // The default topic to publish or subscribe DefaultLoggingLevel = "info" // The default logging level of the application DefaultConnectionBackoffMs = 10000 // The defualt time in milliseconds before retrying to connect to kafka when creating producers // Defaults - Producer only defaults DefaultPartitioner = PartitionHash // The default partitioner for producers DefaultMessageSendIntervalMs = 100 // The default interval between sending messages for producers // Defaults - Consumer only defaults DefaultConsumerGroup = "treeconsumer" // The default consumer group for querying kafka by consumers DefaultAssigner = "range" // The default consumer group assignment method for consumers )
View Source
const ( // User ID range UserIDMax = 5000 // The max possible value of user ID (not inclusive) UserIDMin = 50 // The min possible value of user ID (inclusive) )
View Source
const ( // Hashing PartitionHash = "hash" // compute the hash of the message and send the partition PartitionRand = "rand" // select a random partition PartitionRoundRobin = "roundrobin" // select partition using round robin i.e. (i+1)%n )
Variables ¶
View Source
var MetricsRegistry metrics.Registry
metrics registry
View Source
var SupportedPartitioners = []string{PartitionHash, PartitionRand, PartitionRoundRobin}
Supported partitioners
View Source
var Trees = []string{
"American Beech",
"American Chestnut",
"American Elm",
"American Hophornbeam",
"American Hornbeam",
"American Larch",
"Arborvitae",
"Balsam Fir",
"Basswood",
"Bigtooth Aspen",
"Bitternut Hickory",
"Black Ash",
"Black Birch",
"Black Cherry",
"Black Locust",
"Black Oak",
"Black Walnut",
"Black Willow",
"Butternut",
"Chestnut Oak",
"Cucumber Tree",
"Eastern Cottonwood",
"Eastern Hemlock",
"Eastern Redcedar",
"Eastern White Pine",
"Gray Birch",
"Hawthorn",
"Honey-Locust",
"Northern Red Oak",
"Paper Birch",
"Pignut Hickory",
"Pin Cherry",
"Pitch Pine",
"Quaking Aspen",
"Red Maple",
"Red Pine",
"Red Spruce",
"Sassafras",
"Scarlet Oak",
"Shadbush",
"Shagbark Hickory",
"Silver Maple",
"Slippery Elm",
"Sugar Maple",
"Sycamore",
"The Maples",
"The Oaks",
"Tulip Tree",
"White Ash",
"White Oak",
"White Spruce",
"Yellow Birch",
}
Tree Names
View Source
var UserIDRange = UserIDMax - UserIDMin
Functions ¶
func InitLoggerWithStdOut ¶
InitLoggerWithFileOutput initializes a logger for a given configuration
func Int32SliceEquals ¶
Int32SliceEquals is an O(n) function meant for comparing two int32 slices
func StartMetricsCollector ¶
func StartMetricsCollector(subsystem string)
StartMetricsCollector starts the metric subsystem with an internal registry on port 8080 (and periodically updates)
func StringInSlice ¶
StringInSlice is an O(n) function meant for use where performance is not critical (for unsorted slice)
func StringSliceEquals ¶
StringSliceEquals is an O(n) function meant for comparing two string slices
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.