common

package
v0.0.0-...-1ea6d1a Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConsulConfig

func GetConsulConfig(host string, port int64, prefix string) (config.Config, error)

func NewTracer

func NewTracer(serviceName string, addr string) (opentracing.Tracer, io.Closer, error)

func SwapTo

func SwapTo(request, model interface{}) (err error)

SwapTo 通过json tag 进行结构体赋值

Types

type MysqlConfig

type MysqlConfig struct {
	Host     string `json:"host"`
	User     string `json:"user"`
	Pwd      string `json:"pwd"`
	Database string `json:"database"`
	Port     int64  `json:"port"`
}

func GetMysqlFromConsul

func GetMysqlFromConsul(config config.Config, path ...string) *MysqlConfig

GetMysqlFromConsul 获取mysql的配置

Jump to

Keyboard shortcuts

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