common

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

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

Go to latest
Published: Dec 27, 2022 License: Apache-2.0 Imports: 11 Imported by: 2

README

common

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, category 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

GetMysqlFromConsul 获取mysql的配置

Jump to

Keyboard shortcuts

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