golog

package
v1.0.48 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JsonEncodeNoError added in v1.0.47

func JsonEncodeNoError(data interface{}) string

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(attrs ...*OperationAttr) (*ApiClient, error)

NewApiClient 创建接口实例化 WithGormClient && WithTableName WithMongoCollectionClient && WithDatabaseName && WithCollectionName

func (*ApiClient) GormMiddleware added in v1.0.47

func (c *ApiClient) GormMiddleware(request gorequest.Response)

GormMiddleware 中间件

func (*ApiClient) GormMiddlewareCustom added in v1.0.47

func (c *ApiClient) GormMiddlewareCustom(api string, request gorequest.Response)

GormMiddlewareCustom 中间件

func (*ApiClient) GormMiddlewareXml added in v1.0.47

func (c *ApiClient) GormMiddlewareXml(request gorequest.Response)

GormMiddlewareXml 中间件

func (*ApiClient) GormQuery added in v1.0.47

func (c *ApiClient) GormQuery() *gorm.DB

GormQuery 查询

func (*ApiClient) MongoMiddleware added in v1.0.47

func (c *ApiClient) MongoMiddleware(request gorequest.Response)

MongoMiddleware 中间件

func (*ApiClient) MongoMiddlewareCustom added in v1.0.47

func (c *ApiClient) MongoMiddlewareCustom(api string, request gorequest.Response)

MongoMiddlewareCustom 中间件

func (*ApiClient) MongoMiddlewareXml added in v1.0.47

func (c *ApiClient) MongoMiddlewareXml(request gorequest.Response)

MongoMiddlewareXml 中间件

func (*ApiClient) MongoQuery added in v1.0.47

func (c *ApiClient) MongoQuery() *dorm.MongoClient

MongoQuery 查询

type ConfigGoLog added in v1.0.47

type ConfigGoLog struct {
	LogPath      string // 日志文件路径
	LogName      string // 日志文件名
	LogLevel     string // 日志级别 debug/info/warn/error,debug输出:debug/info/warn/error日志。 info输出:info/warn/error日志。 warn输出:warn/error日志。 error输出:error日志。
	MaxSize      int    // 单个文件大小,MB
	MaxBackups   int    // 保存的文件个数
	MaxAge       int    // 保存的天数 0=不删除
	Compress     bool   // 压缩
	JsonFormat   bool   // 是否输出为json格式
	ShowLine     bool   // 显示代码行
	LogInConsole bool   // 是否同时输出到控制台
}

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(attrs ...*OperationAttr) (*GinClient, error)

NewGinClient 创建框架实例化 WithGormClient && WithTableName WithMongoCollectionClient && WithDatabaseName && WithCollectionName

func (*GinClient) GormMiddleware added in v1.0.47

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

GormMiddleware 中间件

func (*GinClient) GormQuery added in v1.0.47

func (c *GinClient) GormQuery() *gorm.DB

GormQuery 查询

func (*GinClient) MongoMiddleware added in v1.0.47

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

MongoMiddleware 中间件

func (*GinClient) MongoQuery added in v1.0.47

func (c *GinClient) MongoQuery() *dorm.MongoClient

MongoQuery 查询

type GoLog added in v1.0.47

type GoLog struct {
	ConfigGoLog
	Logger *zap.Logger
}

func NewGoLog added in v1.0.47

func NewGoLog(config *ConfigGoLog) *GoLog

type OperationAttr added in v1.0.47

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

OperationAttr 操作属性

func WithCollectionName added in v1.0.47

func WithCollectionName(collectionName string) *OperationAttr

WithCollectionName 设置表名

func WithDatabaseName added in v1.0.47

func WithDatabaseName(databaseName string) *OperationAttr

WithDatabaseName 设置库名

func WithGormClient added in v1.0.47

func WithGormClient(client *gorm.DB) *OperationAttr

WithGormClient 设置数据库驱动

func WithIpService added in v1.0.47

func WithIpService(ipService *goip.Client) *OperationAttr

WithIpService 设置ip服务

func WithMongoClient added in v1.0.47

func WithMongoClient(client *dorm.MongoClient) *OperationAttr

WithMongoClient 设置数据库驱动

func WithTableName added in v1.0.47

func WithTableName(tableName string) *OperationAttr

WithTableName 设置表名

type System added in v1.0.47

type System struct {
	Variable []string // 环境变量
	Hostname string   // 主机名
	Twd      string   // 当前目录
	Uid      int      // 用户ID
	EUid     int      // 有效用户ID
	Gid      int      // 组ID
	EGid     int      // 有效组ID
	Pid      int      // 进程ID
	PPid     int      // 父进程ID
	Version  string   // 版本
}

func (*System) Init added in v1.0.47

func (s *System) Init() *System

type TimeString added in v1.0.47

type TimeString struct {
	Time time.Time
}

func (TimeString) GormDBDataType added in v1.0.47

func (t TimeString) GormDBDataType(db *gorm.DB, field *schema.Field) string

func (TimeString) MarshalJSON added in v1.0.47

func (t TimeString) MarshalJSON() ([]byte, error)

MarshalJSON JSON序列化

func (*TimeString) Scan added in v1.0.47

func (t *TimeString) Scan(value interface{}) error

Scan 查询数据,把字符串转时间

func (*TimeString) UnmarshalJSON added in v1.0.47

func (t *TimeString) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON JSON反序列化

func (TimeString) Value added in v1.0.47

func (t TimeString) Value() (driver.Value, error)

Value 插入数据,把时间转字符串

Jump to

Keyboard shortcuts

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