common

package module
v0.0.0-...-8c6f2f5 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 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)

GetConsulConfig 设置配置中心

func NewTracer

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

NewTracer 创建链路追踪实例

func SwapTo

func SwapTo(request, category 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 的配置

func GetMysqlFromConsulV2

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

Jump to

Keyboard shortcuts

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