bootstrap

package
v0.0.0-...-3d980af Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

README

bootstrap

项目配置资源自举,其中DB、Redis支持插件管理

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConfig

func NewConfig(confFile string) *config.Configuration

NewConfig 初始化配置对象

Types

type LangGoConfig

type LangGoConfig struct {
	Conf *config.Configuration
	Once *sync.Once
}

LangGoConfig 自定义Log

type LangGoLogger

type LangGoLogger struct {
	Logger *zap.Logger
	Once   *sync.Once
}

LangGoLogger 自定义Logger结构

func NewLogger

func NewLogger() *LangGoLogger

NewLogger 生成新Logger

func (*LangGoLogger) NewContext

func (lg *LangGoLogger) NewContext(ctx *gin.Context, fields ...zapcore.Field)

NewContext 给指定的context添加字段 这里的loggerKey是全局变量,所以调用方直接声明变量就能访问到

func (*LangGoLogger) WithContext

func (lg *LangGoLogger) WithContext(ctx *gin.Context) *zap.Logger

WithContext 从指定的context返回一个zap实例

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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