happyConfig

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2020 License: MIT Imports: 3 Imported by: 0

README

github.com/unliar/happysooner-config test

go-micro read config from kv/file/... and scan to struct

how to use

look for examples or index_test.go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	Init config.Config
}

func NewHappyDefaultConf

func NewHappyDefaultConf() (Conf, error)

func (*Conf) GetMySQL

func (c *Conf) GetMySQL(path ...string) (*MySQL, error)

获取 MySQL 配置

func (*Conf) GetNSQ added in v0.0.2

func (c *Conf) GetNSQ(path ...string) (*NSQ, error)

获取 NSQ 配置

func (*Conf) GetRedis

func (c *Conf) GetRedis(path ...string) (*Redis, error)

获取 Redis 配置

func (*Conf) GetSMTP

func (c *Conf) GetSMTP(path ...string) (*SMTP, error)

获取 smtp 配置

type MySQL

type MySQL struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	User     string `json:"user"`
	Password string `json:"password"`
	Database string `json:"database,omitempty"`
}

MySQL Config Model

type NSQ added in v0.0.2

type NSQ struct {
	Host string `json:"host"`
	Port int    `json:"port"`
}

type Redis

type Redis struct {
	Host     string `json:"host"`
	Port     int    `json:"port"`
	Password string `json:"password"`
	Database int    `json:"database,omitempty"`
}

type SMTP

type SMTP struct {
	Host     string `json:"host"`
	User     string `json:"user"`
	Password string `json:"password"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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