Documentation ¶
Index ¶
- func JsonEncodeNoError(data interface{}) string
- type ApiClient
- func (c *ApiClient) GormMiddleware(request gorequest.Response)
- func (c *ApiClient) GormMiddlewareCustom(api string, request gorequest.Response)
- func (c *ApiClient) GormMiddlewareXml(request gorequest.Response)
- func (c *ApiClient) GormQuery() *gorm.DB
- func (c *ApiClient) MongoMiddleware(request gorequest.Response)
- func (c *ApiClient) MongoMiddlewareCustom(api string, request gorequest.Response)
- func (c *ApiClient) MongoMiddlewareXml(request gorequest.Response)
- func (c *ApiClient) MongoQuery() *dorm.MongoClient
- type ConfigGoLog
- type GinClient
- type GoLog
- type OperationAttr
- func WithCollectionName(collectionName string) *OperationAttr
- func WithDatabaseName(databaseName string) *OperationAttr
- func WithGormClient(client *gorm.DB) *OperationAttr
- func WithIpService(ipService *goip.Client) *OperationAttr
- func WithMongoClient(client *dorm.MongoClient) *OperationAttr
- func WithTableName(tableName string) *OperationAttr
- type System
- type TimeString
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
GormMiddleware 中间件
func (*ApiClient) GormMiddlewareCustom ¶ added in v1.0.47
GormMiddlewareCustom 中间件
func (*ApiClient) GormMiddlewareXml ¶ added in v1.0.47
GormMiddlewareXml 中间件
func (*ApiClient) MongoMiddleware ¶ added in v1.0.47
MongoMiddleware 中间件
func (*ApiClient) MongoMiddlewareCustom ¶ added in v1.0.47
MongoMiddlewareCustom 中间件
func (*ApiClient) MongoMiddlewareXml ¶ added in v1.0.47
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) 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 TimeString ¶ added in v1.0.47
func (TimeString) GormDBDataType ¶ added in v1.0.47
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反序列化