common

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

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

Go to latest
Published: Sep 25, 2022 License: GPL-3.0 Imports: 15 Imported by: 6

README

Common methods

.
├── config.go
├── jaeger.go
├── mysql.go
└── swap.go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DPanic

func DPanic(args ...interface{})

func DPanicf

func DPanicf(template string, args ...interface{})

func Debug

func Debug(args ...interface{})

func Debugf

func Debugf(template string, args ...interface{})

func Error

func Error(args ...interface{})

func Errorf

func Errorf(template string, args ...interface{})

func Fatal

func Fatal(args ...interface{})

func Fatalf

func Fatalf(template string, args ...interface{})

func GetConsulConfig

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

GetConsulConfig set the configuration of Consul

func Info

func Info(args ...interface{})

func Infof

func Infof(template string, args ...interface{})

func NewTracer

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

Create Jaeger path tracing

func Panic

func Panic(args ...interface{})

func Panicf

func Panicf(template string, args ...interface{})

func PrometheusBoot

func PrometheusBoot(port int)

func SwapTo

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

SwapTo data assignment by checking json tag

func Warn

func Warn(args ...interface{})

func Warnf

func Warnf(template string, args ...interface{})

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 get mysql config

Jump to

Keyboard shortcuts

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