common

package module
v0.0.0-...-0ace2a4 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: MulanPSL-2.0 Imports: 9 Imported by: 0

README

common

使用go-micro v4版本开发,微服务项目的公共组件

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 GetMysqlFormConsul

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

Jump to

Keyboard shortcuts

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