common

package module
v0.0.0-...-8883785 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: MulanPSL-2.0 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)

创建jaeger链路追踪实例

func SwapTo

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

通过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

获取mysql的配置

Jump to

Keyboard shortcuts

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