g

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VERSION = "0.0.5"
)

Variables

View Source
var (
	Logger *log.Logger
	Ipaddr string
)
View Source
var (
	ConfigFile string
)

Functions

func InitLog

func InitLog() *log.Logger

func ParseConfig

func ParseConfig(cfg string)

Types

type ClusterNode

type ClusterNode struct {
	Addrs []string `json:"addrs"`
}

CLUSTER NODE

func NewClusterNode

func NewClusterNode(addrs []string) *ClusterNode

type ConsumerConfig

type ConsumerConfig struct {
	KafkaVersion  string   `json:kafkaVersion`
	Topics        []string `json:topics`
	Group         string   `json:group`
	Offset        string   `json:offset`
	OffsetTimeout int      `json:offsetTimeout`
	Concurrent    int      `json:concurrent`
	Zookeeper     string   `json:zookeeper`
	Kafka         []string `json:kafka`
}

type GlobalConfig

type GlobalConfig struct {
	Debug        bool            `json:"debug"`
	DebugTrend   bool            `json:"debugtrend"`
	DebugTraffer bool            `json:"debugtraffer"`
	LogMaxAge    int             `json:"logmaxage"`
	LogRotateAge int             `json:"logrotateage"`
	LogFile      string          `json:"logfile"`
	Http         *HttpConfig     `json:"http"`
	Consumer     *ConsumerConfig `json:"consumer"`
	Trend        *TrendConfig    `json:"trend"`
	Transfer     *TransferConfig `json:"transfer"`
	PercentCheck map[string]bool `json:"percent_check"`
	IgnoreHost   map[string]bool `json:"ignore_host"`
}

func Config

func Config() *GlobalConfig

type HttpConfig

type HttpConfig struct {
	Enabled bool   `json:"enabled"`
	Listen  string `json:"listen"`
}

type TransferConfig

type TransferConfig struct {
	Enabled     bool              `json:"enabled"`
	Batch       int               `json:"batch"`
	Retry       int               `json:"retry"`
	ConnTimeout int               `json:"connTimeout"`
	CallTimeout int               `json:"callTimeout"`
	MaxConns    int               `json:"maxConns"`
	MaxIdle     int               `json:"maxIdle"`
	Cluster     map[string]string `json:"cluster"`
}

type TrendConfig

type TrendConfig struct {
	Enabled     bool              `json:"enabled"`
	Batch       int               `json:"batch"`
	ConnTimeout int               `json:"connTimeout"`
	CallTimeout int               `json:"callTimeout"`
	MaxConns    int               `json:"maxConns"`
	MaxIdle     int               `json:"maxIdle"`
	Replicas    int               `json:"replicas"`
	Cluster     map[string]string `json:"cluster"`
}

Jump to

Keyboard shortcuts

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