config

package
v0.0.0-...-7c4ebca Latest Latest
Warning

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

Go to latest
Published: May 25, 2017 License: MIT Imports: 1 Imported by: 2

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 {
	Server   ServerInfo   `mapstructure:"server"`
	Influxdb InfluxdbInfo `mapstructure:"influxdb"`
	Mongodb  MongodbInfo  `mapstructure:"mongodb"`
}

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 InfluxdbInfo

type InfluxdbInfo struct {
	Address string `mapstructure:"addr"`
	DBName  string `mapstructure:"db_name"`
}

Influxdb information

type MongodbInfo

type MongodbInfo struct {
	Address string `mapstructure:"addr"`
	DBName  string `mapstructure:"db_name"`
}

Mongodb information

type ServerInfo

type ServerInfo struct {
	Address string `mapstructure:"addr"`
}

Server information

Jump to

Keyboard shortcuts

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