Documentation ¶
Index ¶
- Variables
- func GetConfig() *goconfig.ConfigFile
- func GetLocalIPs() (ips []net.IP)
- func GetTraceId() (traceId string)
- func InArrayString(s string, arr []string) bool
- func InitConfigFile(configFile string)
- func InitDatabase() error
- func InitLogs()
- func InitRedis()
- func New(l *Logger) (*zap.Logger, error)
- func NewSpanId() string
- func RegisterComponent(c Destroyable)
- func Substr(str string, start int64, end int64) string
- type Config
- type Db
- type Destroyable
- type LogConfig
- type Logger
- type RedisPool
- type Trace
- type TraceContext
Constants ¶
This section is empty.
Variables ¶
View Source
var AccessLogger *zap.Logger
View Source
var DateFormat = "2006-01-02"
View Source
var DefLogger *zap.Logger
View Source
var DefaultDbPool *gorm.DB
View Source
var DefaultRedisPool *redis.Pool
View Source
var Destroyables []Destroyable
View Source
var LocalIP = net.ParseIP("127.0.0.1")
View Source
var TimeFormat = "2006-01-02 15:04:05"
View Source
var TimeLocation *time.Location
Functions ¶
func GetConfig ¶
func GetConfig() *goconfig.ConfigFile
func GetLocalIPs ¶
func GetTraceId ¶
func GetTraceId() (traceId string)
func InArrayString ¶
func InitConfigFile ¶
func InitConfigFile(configFile string)
func InitDatabase ¶
func InitDatabase() error
func RegisterComponent ¶
func RegisterComponent(c Destroyable)
Types ¶
type Destroyable ¶
type Destroyable interface {
Destroy()
}
type Logger ¶
type Logger struct { Mode string Level string Name, Alone, Path, UUIDPath, ErrPath string MaxSize int MaxBackups int MaxAge int Compress bool //日志是否为json结构 Json bool }
Logger 参数
type TraceContext ¶
func NewTrace ¶
func NewTrace() *TraceContext
Click to show internal directories.
Click to hide internal directories.