config

package
v0.0.0-...-ff2426d Latest Latest
Warning

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

Go to latest
Published: May 29, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Listen       string                 `toml:"listen"`
	RedisServers map[string]RedisServer `toml:"redisservers"`
}

Config 对应配置文件结构

func UnmarshalConfig

func UnmarshalConfig(tomlfile string) (*Config, error)

UnmarshalConfig 解析toml配置

func (Config) GetListenAddr

func (c Config) GetListenAddr() string

GetListenAddr 监听地址

func (Config) RedisServerConf

func (c Config) RedisServerConf(key string) (RedisServer, bool)

RedisServerConf 获取数据库配置

type RedisServer

type RedisServer struct {
	Addr     string `toml:"addr"`
	Password string `toml:"password"`
	DB       int    `toml:"db"`
}

RedisServer 表示 redis 服务器配置

Jump to

Keyboard shortcuts

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