config

package
Version: v0.0.0-...-b042743 Latest Latest
Warning

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

Go to latest
Published: May 12, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "0.0.1"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Sinker SinkerInfo `mapstructure:"sinker" json:"sinker"`
	Kafka  KafkaInfo  `mapstructure:"kafka" json:"kafka"`
}

Config sturcture

func GetConfig

func GetConfig() *Config

Get singleton config

func NewConfig

func NewConfig() *Config

New Config

func (*Config) Init

func (config *Config) Init(path string) error

Init config from json file

type KafkaInfo

type KafkaInfo struct {
	Broker     []string `mapstructure:"broker" json:"broker"`
	Topic      string   `mapstructure:"topic" json:"topic"`
	Partitions []int32  `mapstructure:"partitions" json:"partitions"`
}

Kafka

type SinkerInfo

type SinkerInfo struct {
	LogPath          string `mapstructure:"log_path" json:"log_path"`
	LogFileMaxSize   int64  `mapstructure:"log_file_max_size" json:"log_file_max_size"`
	LogFlushDuration uint32 `mapstructure:"log_flush_duration" json:"log_flush_duration"`
	LogQueueSize     uint32 `mapstructure:"log_queue_size" json:"log_queue_size"`
}

Sinker

Source Files

Jump to

Keyboard shortcuts

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