golog

package
v1.0.88 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiClient added in v1.0.47

type ApiClient struct {
	// contains filtered or unexported fields
}

ApiClient 接口

func NewApiClient added in v1.0.47

func NewApiClient(config *ApiClientConfig) (*ApiClient, error)

NewApiClient 创建接口实例化

func (*ApiClient) GormCustomTableDelete added in v1.0.69

func (c *ApiClient) GormCustomTableDelete(ctx context.Context, tableName string, hour int64) error

GormCustomTableDelete 删除数据 - 自定义表名

func (*ApiClient) GormDelete added in v1.0.52

func (c *ApiClient) GormDelete(ctx context.Context, hour int64) error

GormDelete 删除

func (*ApiClient) Middleware added in v1.0.52

func (c *ApiClient) Middleware(ctx context.Context, request gorequest.Response, sdkVersion string)

Middleware 中间件

func (*ApiClient) MiddlewareCustom added in v1.0.52

func (c *ApiClient) MiddlewareCustom(ctx context.Context, api string, request gorequest.Response, sdkVersion string)

MiddlewareCustom 中间件

func (*ApiClient) MiddlewareXml added in v1.0.52

func (c *ApiClient) MiddlewareXml(ctx context.Context, request gorequest.Response, sdkVersion string)

MiddlewareXml 中间件

type ApiClientConfig added in v1.0.52

type ApiClientConfig struct {
	GormClientFun  dorm.GormClientTableFun       // 日志配置
	MongoClientFun dorm.MongoClientCollectionFun // 日志配置
	ZapLog         *ZapLog                       // 日志服务
	CurrentIp      string                        // 当前ip
}

ApiClientConfig 接口实例配置

type ApiClientFun added in v1.0.52

type ApiClientFun func() *ApiClient

ApiClientFun *ApiClient 驱动

type GinClient added in v1.0.47

type GinClient struct {
	// contains filtered or unexported fields
}

GinClient 框架

func NewGinClient added in v1.0.47

func NewGinClient(config *GinClientConfig) (*GinClient, error)

NewGinClient 创建框架实例化

func (*GinClient) GormCustomTableDelete added in v1.0.69

func (c *GinClient) GormCustomTableDelete(ctx context.Context, tableName string, hour int64) error

GormCustomTableDelete 删除数据 - 自定义表名

func (*GinClient) GormDelete added in v1.0.52

func (c *GinClient) GormDelete(ctx context.Context, hour int64) error

GormDelete 删除

func (*GinClient) Middleware added in v1.0.52

func (c *GinClient) Middleware() gin.HandlerFunc

Middleware 中间件

type GinClientConfig added in v1.0.52

type GinClientConfig struct {
	IpService      *goip.Client                  // ip服务
	GormClientFun  dorm.GormClientTableFun       // 日志配置
	MongoClientFun dorm.MongoClientCollectionFun // 日志配置
	ZapLog         *ZapLog                       // 日志服务
	CurrentIp      string                        // 当前ip
}

GinClientConfig 框架实例配置

type GinClientFun added in v1.0.52

type GinClientFun func() *GinClient

GinClientFun *GinClient 驱动

type ZapLog added in v1.0.52

type ZapLog struct {
	// contains filtered or unexported fields
}

func NewZapLog added in v1.0.52

func NewZapLog(config *ZapLogConfig) *ZapLog

func (*ZapLog) WithLogger added in v1.0.52

func (zl *ZapLog) WithLogger() *zap.Logger

WithLogger 跟踪编号

func (*ZapLog) WithTraceId added in v1.0.52

func (zl *ZapLog) WithTraceId(ctx context.Context) *zap.Logger

WithTraceId 跟踪编号

func (*ZapLog) WithTraceIdStr added in v1.0.52

func (zl *ZapLog) WithTraceIdStr(traceId string) *zap.Logger

WithTraceIdStr 跟踪编号

type ZapLogConfig added in v1.0.52

type ZapLogConfig struct {
	LogPath      string // 日志文件路径
	LogName      string // 日志文件名
	MaxSize      int    // 单位为MB,默认为512MB
	MaxBackups   int    // 保留旧文件的最大个数
	MaxAge       int    // 文件最多保存多少天 0=不删除
	LocalTime    bool   // 采用本地时间
	Compress     bool   // 是否压缩日志
	JsonFormat   bool   // 是否输出为json格式
	ShowLine     bool   // 显示代码行
	LogInConsole bool   // 是否同时输出到控制台
}

Jump to

Keyboard shortcuts

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