Documentation ¶
Index ¶
- Constants
- func JsonDecodeNoError(b []byte) map[string]interface{}
- func XmlDecodeNoError(b []byte) map[string]interface{}
- type BeegoClient
- type BsonTime
- type BunClient
- type ConfigBeegoClient
- type ConfigBunClient
- type ConfigGormClient
- type ConfigMongoClient
- type ConfigRedisClient
- type ConfigXormClient
- type ConfigZormClient
- type DBGttFunc
- type DBGttInterfaceFunc
- type DBGttJsonFunc
- type DBGttStringFunc
- type FindManyResult
- type FindManyResultI
- type FindOneResult
- type FindOneResultI
- type FindResult
- type FindResultI
- type GormClient
- type HashOperation
- type Iterator
- type JsonGttFunc
- type ListOperation
- func (cl *ListOperation) Index(key string, index int64) *redis.StringCmd
- func (cl *ListOperation) Insert(key, op string, pivot, value interface{}) *redis.IntCmd
- func (cl *ListOperation) LPop(key string) *redis.StringCmd
- func (cl *ListOperation) LPush(key string, value interface{}) *redis.IntCmd
- func (cl *ListOperation) LPushX(key string, value interface{}) *redis.IntCmd
- func (cl *ListOperation) Len(key string) *redis.IntCmd
- func (cl *ListOperation) RPop(key string) *redis.StringCmd
- func (cl *ListOperation) RPush(key string, value interface{}) *redis.IntCmd
- func (cl *ListOperation) RPushX(key string, value interface{}) *redis.IntCmd
- func (cl *ListOperation) Range(key string, start, stop int64) *redis.StringSliceCmd
- func (cl *ListOperation) RangeAli(key string) *redis.StringSliceCmd
- func (cl *ListOperation) Rem(key string, count int64, value interface{}) *redis.IntCmd
- type MongoClient
- func (c *MongoClient) AggregateByFiltersSort(pipeline interface{}) (result *mongo.Cursor, err error)
- func (c *MongoClient) Begin() (ms MongoTransaction, err error)
- func (c *MongoClient) Close() error
- func (c *MongoClient) Collection(collectionName string) *MongoClient
- func (c *MongoClient) CollectionCount() (name string, size int64)
- func (c *MongoClient) CollectionDocuments(Skip, Limit int64, sort int, key string, value interface{}) (result *mongo.Cursor, err error)
- func (c *MongoClient) CountDocumentsByFilters(filter interface{}) (count int64, err error)
- func (c *MongoClient) Database(databaseName string) *MongoClient
- func (c *MongoClient) Delete(filter interface{}) (err error)
- func (c *MongoClient) DeleteId(id interface{}) (err error)
- func (c *MongoClient) DeleteMany(filter interface{}) (result *mongo.DeleteResult, err error)
- func (c *MongoClient) Find(filter interface{}) (*mongo.Cursor, error)
- func (c *MongoClient) FindCollection(Limit int64) (result *mongo.Cursor, err error)
- func (c *MongoClient) FindCollectionSort(Sort interface{}, Limit int64) (result *mongo.Cursor, err error)
- func (c *MongoClient) FindMany(filter interface{}) (*mongo.Cursor, error)
- func (c *MongoClient) FindManyByFilters(filter interface{}) (result *mongo.Cursor, err error)
- func (c *MongoClient) FindManyByFiltersSort(filter interface{}, Sort interface{}) (result *mongo.Cursor, err error)
- func (c *MongoClient) FindManyCollectionSort(filter interface{}, Sort interface{}) (result *mongo.Cursor, err error)
- func (c *MongoClient) FindOne(filter interface{}) *mongo.SingleResult
- func (c *MongoClient) GetDb() *mongo.Client
- func (c *MongoClient) InsertMany(documents []interface{}) (result *mongo.InsertManyResult, err error)
- func (c *MongoClient) InsertOne(document interface{}) (result *mongo.InsertOneResult, err error)
- func (c *MongoClient) Model(value interface{}) *MongoClient
- func (c *MongoClient) UpdateId(id interface{}, update interface{}) (err error)
- func (c *MongoClient) UpdateMany(filter interface{}, update interface{}) (result *mongo.UpdateResult, err error)
- func (c *MongoClient) UpdateOne(filter interface{}, update interface{}) (err error)
- type MongoTransaction
- func (ms *MongoTransaction) AggregateByFiltersSort(pipeline interface{}) (result *mongo.Cursor, err error)
- func (ms *MongoTransaction) Close()
- func (ms *MongoTransaction) Collection(collectionName string) *MongoTransaction
- func (ms *MongoTransaction) CollectionCount(ctx context.Context) (name string, size int64)
- func (ms *MongoTransaction) CollectionDocuments(Skip, Limit int64, sort int, key string, value interface{}) (result *mongo.Cursor, err error)
- func (ms *MongoTransaction) Commit() error
- func (ms *MongoTransaction) CountDocumentsByFilters(filter interface{}) (count int64, err error)
- func (ms *MongoTransaction) Database(databaseName string) *MongoTransaction
- func (ms *MongoTransaction) Delete(filter interface{}) (err error)
- func (ms *MongoTransaction) DeleteId(id interface{}) (err error)
- func (ms *MongoTransaction) DeleteMany(key string, value interface{}) (result *mongo.DeleteResult, err error)
- func (ms *MongoTransaction) Find(filter interface{}) (*mongo.Cursor, error)
- func (ms *MongoTransaction) FindCollection(Limit int64) (result *mongo.Cursor, err error)
- func (ms *MongoTransaction) FindCollectionSort(Sort interface{}, Limit int64) (result *mongo.Cursor, err error)
- func (ms *MongoTransaction) FindMany(filter interface{}) (*mongo.Cursor, error)
- func (ms *MongoTransaction) FindManyByFilters(filter interface{}) (result *mongo.Cursor, err error)
- func (ms *MongoTransaction) FindManyByFiltersSort(filter interface{}, Sort interface{}) (result *mongo.Cursor, err error)
- func (ms *MongoTransaction) FindManyCollectionSort(filter interface{}, Sort interface{}) (result *mongo.Cursor, err error)
- func (ms *MongoTransaction) FindOne(filter interface{}) *mongo.SingleResult
- func (ms *MongoTransaction) InsertMany(documents []interface{}) (result *mongo.InsertManyResult, err error)
- func (ms *MongoTransaction) InsertOne(document interface{}) (result *mongo.InsertOneResult, err error)
- func (ms *MongoTransaction) Model(value interface{}) *MongoTransaction
- func (ms *MongoTransaction) Rollback() error
- func (ms *MongoTransaction) UpdateId(id interface{}, update interface{}) (err error)
- func (ms *MongoTransaction) UpdateMany(filter interface{}, update interface{}) (result *mongo.UpdateResult, err error)
- func (ms *MongoTransaction) UpdateOne(filter interface{}, update interface{}) (err error)
- type OperationAttr
- type OperationAttrs
- type RedisClient
- func (c *RedisClient) GetDb() *redis.Client
- func (c *RedisClient) NewListOperation() *ListOperation
- func (c *RedisClient) NewSimpleCache(operation *StringOperation, expire time.Duration, serializer string) *SimpleCache
- func (c *RedisClient) NewSimpleInterfaceCache(operation *SimpleOperation, expire time.Duration) *SimpleInterfaceCache
- func (c *RedisClient) NewSimpleJsonCache(operation *StringOperation, expire time.Duration) *SimpleJsonCache
- func (c *RedisClient) NewSimpleOperation() *SimpleOperation
- func (c *RedisClient) NewSimpleStringCache(operation *StringOperation, expire time.Duration) *SimpleStringCache
- func (c *RedisClient) NewStringOperation() *StringOperation
- type RedisClient6
- type RedisClient7
- type SimpleCache
- type SimpleInterfaceCache
- type SimpleJsonCache
- type SimpleOperation
- type SimpleResult
- type SimpleStringCache
- type SliceResult
- type StringOperation
- type StringResult
- type UpperClient
- func NewUpperCockroachdbClient(settings cockroachdb.ConnectionURL) (*UpperClient, error)
- func NewUpperMongodbClient(settings mongo.ConnectionURL) (*UpperClient, error)
- func NewUpperMssqlClient(settings mssql.ConnectionURL) (*UpperClient, error)
- func NewUpperMysqlClient(settings mysql.ConnectionURL) (*UpperClient, error)
- func NewUpperPostgresqlClient(settings postgresql.ConnectionURL) (*UpperClient, error)
- func NewUpperQlClient(settings ql.ConnectionURL) (*UpperClient, error)
- type XormClient
- type XormClientSession
- type ZormClient
Constants ¶
const ( AttrExpr = "expr" // 过期时间 AttrNx = "nx" // 设置Nx )
const ( SerializerJson = "json" SerializerString = "string" )
Variables ¶
This section is empty.
Functions ¶
func JsonDecodeNoError ¶
JsonDecodeNoError Json解码,不报错
func XmlDecodeNoError ¶
XmlDecodeNoError Xml解码,不报错
Types ¶
type BeegoClient ¶
BeegoClient https://beego.vip/
func NewBeegoMysqlClient ¶
func NewBeegoMysqlClient(config *ConfigBeegoClient) (*BeegoClient, error)
func NewBeegoOracleClient ¶
func NewBeegoOracleClient(config *ConfigBeegoClient) (*BeegoClient, error)
func NewBeegoPgsqlClient ¶
func NewBeegoPgsqlClient(config *ConfigBeegoClient) (*BeegoClient, error)
func NewBeegoTidbClient ¶
func NewBeegoTidbClient(config *ConfigBeegoClient) (*BeegoClient, error)
type BsonTime ¶
BsonTime 类型
func (BsonTime) MarshalBSONValue ¶
MarshalBSONValue 实现bson序列化
func (*BsonTime) UnmarshalBSONValue ¶
UnmarshalBSONValue 实现bson反序列化
func (*BsonTime) UnmarshalJSON ¶
UnmarshalJSON 实现json反序列化
type BunClient ¶
BunClient https://bun.uptrace.dev/
func NewBunMssqlClient ¶
func NewBunMssqlClient(config *ConfigBunClient) (*BunClient, error)
func NewBunMysqlClient ¶
func NewBunMysqlClient(config *ConfigBunClient) (*BunClient, error)
func NewBunPgsqlClient ¶
func NewBunPgsqlClient(config *ConfigBunClient) (*BunClient, error)
type ConfigBeegoClient ¶
type ConfigBeegoClient struct {
Dns string // 地址
}
type ConfigBunClient ¶
type ConfigBunClient struct {
Dns string // 地址
}
type ConfigGormClient ¶
type ConfigMongoClient ¶
type ConfigMongoClient struct { Dns string // 地址 Opts *options.ClientOptions DatabaseName string // 库名 }
type ConfigRedisClient ¶
type ConfigXormClient ¶
type ConfigXormClient struct {
Dns string // 地址
}
type ConfigZormClient ¶
type ConfigZormClient struct {
Dns string // 地址
}
type DBGttInterfaceFunc ¶
type DBGttInterfaceFunc func() interface{}
type DBGttJsonFunc ¶
type DBGttJsonFunc func() interface{}
type DBGttStringFunc ¶
type DBGttStringFunc func() string
type FindManyResult ¶
type FindManyResult struct {
// contains filtered or unexported fields
}
func (*FindManyResult) Many ¶
func (f *FindManyResult) Many(result interface{}) error
type FindManyResultI ¶
type FindManyResultI interface {
Many(result interface{}) error
}
type FindOneResult ¶
type FindOneResult struct {
// contains filtered or unexported fields
}
func (*FindOneResult) One ¶
func (f *FindOneResult) One(result interface{}) error
type FindOneResultI ¶
type FindOneResultI interface {
One(result interface{}) error
}
type FindResult ¶
type FindResult struct {
// contains filtered or unexported fields
}
func (*FindResult) Many ¶
func (f *FindResult) Many(result interface{}) error
type FindResultI ¶
type FindResultI interface {
Many(result interface{}) error
}
type GormClient ¶
GormClient https://gorm.io/
func NewGormMysqlClient ¶
func NewGormMysqlClient(config *ConfigGormClient) (*GormClient, error)
func NewGormPostgresClient ¶
func NewGormPostgresClient(config *ConfigGormClient) (*GormClient, error)
func NewGormPostgresqlClient ¶
func NewGormPostgresqlClient(config *ConfigGormClient) (*GormClient, error)
func NewGormSqlServerClient ¶
func NewGormSqlServerClient(config *ConfigGormClient) (*GormClient, error)
func (*GormClient) GetDb ¶
func (c *GormClient) GetDb() *gorm.DB
type HashOperation ¶
type HashOperation struct {
// contains filtered or unexported fields
}
func NewHashOperation ¶
func NewHashOperation(db *redis.Client, ctx context.Context) *HashOperation
NewHashOperation hash类型数据操作 https://www.tizi365.com/archives/296.html
func (*HashOperation) Get ¶
func (cl *HashOperation) Get(key, field string) *redis.StringCmd
Get 根据key和field字段设置,field字段的值
func (*HashOperation) Set ¶
func (cl *HashOperation) Set(key string, value interface{}) *redis.IntCmd
Set 根据key和field字段设置,field字段的值
type JsonGttFunc ¶
type JsonGttFunc func() interface{}
type ListOperation ¶
type ListOperation struct {
// contains filtered or unexported fields
}
func (*ListOperation) Index ¶
func (cl *ListOperation) Index(key string, index int64) *redis.StringCmd
Index 根据索引坐标,查询key中的数据
func (*ListOperation) Insert ¶
func (cl *ListOperation) Insert(key, op string, pivot, value interface{}) *redis.IntCmd
Insert 在指定位置插入数据
func (*ListOperation) LPop ¶
func (cl *ListOperation) LPop(key string) *redis.StringCmd
LPop 从列表左边删除第一个数据,并返回删除的数据
func (*ListOperation) LPush ¶
func (cl *ListOperation) LPush(key string, value interface{}) *redis.IntCmd
LPush 从列表左边插入数据
func (*ListOperation) LPushX ¶
func (cl *ListOperation) LPushX(key string, value interface{}) *redis.IntCmd
LPushX 跟LPush的区别是,仅当列表存在的时候才插入数据
func (*ListOperation) RPop ¶
func (cl *ListOperation) RPop(key string) *redis.StringCmd
RPop 从列表的右边删除第一个数据,并返回删除的数据
func (*ListOperation) RPush ¶
func (cl *ListOperation) RPush(key string, value interface{}) *redis.IntCmd
RPush 从列表右边插入数据
func (*ListOperation) RPushX ¶
func (cl *ListOperation) RPushX(key string, value interface{}) *redis.IntCmd
RPushX 跟RPush的区别是,仅当列表存在的时候才插入数据
func (*ListOperation) Range ¶
func (cl *ListOperation) Range(key string, start, stop int64) *redis.StringSliceCmd
Range 返回列表的一个范围内的数据,也可以返回全部数据
func (*ListOperation) RangeAli ¶
func (cl *ListOperation) RangeAli(key string) *redis.StringSliceCmd
RangeAli 返回key全部数据
func (*ListOperation) Rem ¶
func (cl *ListOperation) Rem(key string, count int64, value interface{}) *redis.IntCmd
Rem 删除key中的数据
type MongoClient ¶
func NewMongoClient ¶
func NewMongoClient(config *ConfigMongoClient) (*MongoClient, error)
func (*MongoClient) AggregateByFiltersSort ¶
func (c *MongoClient) AggregateByFiltersSort(pipeline interface{}) (result *mongo.Cursor, err error)
AggregateByFiltersSort 统计分析
func (*MongoClient) Begin ¶
func (c *MongoClient) Begin() (ms MongoTransaction, err error)
Begin 开始事务,会同时创建开始会话需要在退出时关闭会话
func (*MongoClient) Collection ¶
func (c *MongoClient) Collection(collectionName string) *MongoClient
Collection 设置表名
func (*MongoClient) CollectionCount ¶
func (c *MongoClient) CollectionCount() (name string, size int64)
CollectionCount 查询集合里有多少数据
func (*MongoClient) CollectionDocuments ¶
func (c *MongoClient) CollectionDocuments(Skip, Limit int64, sort int, key string, value interface{}) (result *mongo.Cursor, err error)
CollectionDocuments 按选项查询集合 Skip 跳过 Limit 读取数量 sort 1 ,-1 . 1 为升序 , -1 为降序
func (*MongoClient) CountDocumentsByFilters ¶
func (c *MongoClient) CountDocumentsByFilters(filter interface{}) (count int64, err error)
CountDocumentsByFilters 统计数量
func (*MongoClient) Database ¶
func (c *MongoClient) Database(databaseName string) *MongoClient
Database 设置库名
func (*MongoClient) Delete ¶
func (c *MongoClient) Delete(filter interface{}) (err error)
Delete 删除文档
func (*MongoClient) DeleteId ¶
func (c *MongoClient) DeleteId(id interface{}) (err error)
DeleteId 删除文档
func (*MongoClient) DeleteMany ¶
func (c *MongoClient) DeleteMany(filter interface{}) (result *mongo.DeleteResult, err error)
DeleteMany 删除多个文档
func (*MongoClient) Find ¶
func (c *MongoClient) Find(filter interface{}) (*mongo.Cursor, error)
Find 查询
func (*MongoClient) FindCollection ¶
func (c *MongoClient) FindCollection(Limit int64) (result *mongo.Cursor, err error)
FindCollection 查询集合文档
func (*MongoClient) FindCollectionSort ¶
func (c *MongoClient) FindCollectionSort(Sort interface{}, Limit int64) (result *mongo.Cursor, err error)
FindCollectionSort 查询集合文档支持排序
func (*MongoClient) FindMany ¶
func (c *MongoClient) FindMany(filter interface{}) (*mongo.Cursor, error)
FindMany 查询多个文档
func (*MongoClient) FindManyByFilters ¶
func (c *MongoClient) FindManyByFilters(filter interface{}) (result *mongo.Cursor, err error)
FindManyByFilters 多条件查询
func (*MongoClient) FindManyByFiltersSort ¶
func (c *MongoClient) FindManyByFiltersSort(filter interface{}, Sort interface{}) (result *mongo.Cursor, err error)
FindManyByFiltersSort 多条件查询支持排序
func (*MongoClient) FindManyCollectionSort ¶
func (c *MongoClient) FindManyCollectionSort(filter interface{}, Sort interface{}) (result *mongo.Cursor, err error)
FindManyCollectionSort 查询集合文档支持排序支持条件
func (*MongoClient) FindOne ¶
func (c *MongoClient) FindOne(filter interface{}) *mongo.SingleResult
FindOne 查询单个文档
func (*MongoClient) InsertMany ¶
func (c *MongoClient) InsertMany(documents []interface{}) (result *mongo.InsertManyResult, err error)
InsertMany 插入多个文档
func (*MongoClient) InsertOne ¶
func (c *MongoClient) InsertOne(document interface{}) (result *mongo.InsertOneResult, err error)
InsertOne 插入一个文档
func (*MongoClient) Model ¶
func (c *MongoClient) Model(value interface{}) *MongoClient
Model 传入模型自动获取库名和表名
func (*MongoClient) UpdateId ¶
func (c *MongoClient) UpdateId(id interface{}, update interface{}) (err error)
UpdateId 更新单个文档 修改字段的值($set) 字段增加值 inc($inc) 从数组中增加一个元素 push($push) 从数组中删除一个元素 pull($pull)
func (*MongoClient) UpdateMany ¶
func (c *MongoClient) UpdateMany(filter interface{}, update interface{}) (result *mongo.UpdateResult, err error)
UpdateMany 更新多个文档 修改字段的值($set) 字段增加值 inc($inc) 从数组中增加一个元素 push($push) 从数组中删除一个元素 pull($pull)
func (*MongoClient) UpdateOne ¶
func (c *MongoClient) UpdateOne(filter interface{}, update interface{}) (err error)
UpdateOne 更新单个文档 修改字段的值($set) 字段增加值 inc($inc) 从数组中增加一个元素 push($push) 从数组中删除一个元素 pull($pull)
type MongoTransaction ¶
type MongoTransaction struct { Session mongo.SessionContext // contains filtered or unexported fields }
func (*MongoTransaction) AggregateByFiltersSort ¶
func (ms *MongoTransaction) AggregateByFiltersSort(pipeline interface{}) (result *mongo.Cursor, err error)
AggregateByFiltersSort 统计分析
func (*MongoTransaction) Collection ¶
func (ms *MongoTransaction) Collection(collectionName string) *MongoTransaction
Collection 设置表名
func (*MongoTransaction) CollectionCount ¶
func (ms *MongoTransaction) CollectionCount(ctx context.Context) (name string, size int64)
CollectionCount 查询集合里有多少数据
func (*MongoTransaction) CollectionDocuments ¶
func (ms *MongoTransaction) CollectionDocuments(Skip, Limit int64, sort int, key string, value interface{}) (result *mongo.Cursor, err error)
CollectionDocuments 按选项查询集合 Skip 跳过 Limit 读取数量 sort 1 ,-1 . 1 为升序 , -1 为降序
func (*MongoTransaction) CountDocumentsByFilters ¶
func (ms *MongoTransaction) CountDocumentsByFilters(filter interface{}) (count int64, err error)
CountDocumentsByFilters 统计数量
func (*MongoTransaction) Database ¶
func (ms *MongoTransaction) Database(databaseName string) *MongoTransaction
Database 设置库名
func (*MongoTransaction) Delete ¶
func (ms *MongoTransaction) Delete(filter interface{}) (err error)
Delete 删除文档
func (*MongoTransaction) DeleteId ¶
func (ms *MongoTransaction) DeleteId(id interface{}) (err error)
DeleteId 删除文档
func (*MongoTransaction) DeleteMany ¶
func (ms *MongoTransaction) DeleteMany(key string, value interface{}) (result *mongo.DeleteResult, err error)
DeleteMany 删除多个文档
func (*MongoTransaction) Find ¶
func (ms *MongoTransaction) Find(filter interface{}) (*mongo.Cursor, error)
Find 查询
func (*MongoTransaction) FindCollection ¶
func (ms *MongoTransaction) FindCollection(Limit int64) (result *mongo.Cursor, err error)
FindCollection 查询集合文档
func (*MongoTransaction) FindCollectionSort ¶
func (ms *MongoTransaction) FindCollectionSort(Sort interface{}, Limit int64) (result *mongo.Cursor, err error)
FindCollectionSort 查询集合文档支持排序
func (*MongoTransaction) FindMany ¶
func (ms *MongoTransaction) FindMany(filter interface{}) (*mongo.Cursor, error)
FindMany 查询多个文档
func (*MongoTransaction) FindManyByFilters ¶
func (ms *MongoTransaction) FindManyByFilters(filter interface{}) (result *mongo.Cursor, err error)
FindManyByFilters 多条件查询
func (*MongoTransaction) FindManyByFiltersSort ¶
func (ms *MongoTransaction) FindManyByFiltersSort(filter interface{}, Sort interface{}) (result *mongo.Cursor, err error)
FindManyByFiltersSort 多条件查询支持排序
func (*MongoTransaction) FindManyCollectionSort ¶
func (ms *MongoTransaction) FindManyCollectionSort(filter interface{}, Sort interface{}) (result *mongo.Cursor, err error)
FindManyCollectionSort 查询集合文档支持排序支持条件
func (*MongoTransaction) FindOne ¶
func (ms *MongoTransaction) FindOne(filter interface{}) *mongo.SingleResult
FindOne 查询单个文档
func (*MongoTransaction) InsertMany ¶
func (ms *MongoTransaction) InsertMany(documents []interface{}) (result *mongo.InsertManyResult, err error)
InsertMany 插入多个文档
func (*MongoTransaction) InsertOne ¶
func (ms *MongoTransaction) InsertOne(document interface{}) (result *mongo.InsertOneResult, err error)
InsertOne 插入一个文档
func (*MongoTransaction) Model ¶
func (ms *MongoTransaction) Model(value interface{}) *MongoTransaction
Model 传入模型自动获取库名和表名
func (*MongoTransaction) UpdateId ¶
func (ms *MongoTransaction) UpdateId(id interface{}, update interface{}) (err error)
UpdateId 更新单个文档 修改字段的值($set) 字段增加值 inc($inc) 从数组中增加一个元素 push($push) 从数组中删除一个元素 pull($pull)
func (*MongoTransaction) UpdateMany ¶
func (ms *MongoTransaction) UpdateMany(filter interface{}, update interface{}) (result *mongo.UpdateResult, err error)
UpdateMany 更新多个文档 修改字段的值($set) 字段增加值 inc($inc) 从数组中增加一个元素 push($push) 从数组中删除一个元素 pull($pull)
func (*MongoTransaction) UpdateOne ¶
func (ms *MongoTransaction) UpdateOne(filter interface{}, update interface{}) (err error)
UpdateOne 更新单个文档 修改字段的值($set) 字段增加值 inc($inc) 从数组中增加一个元素 push($push) 从数组中删除一个元素 pull($pull)
type OperationAttr ¶
type OperationAttr struct { Name string Value interface{} }
func WithNX ¶
func WithNX() *OperationAttr
type OperationAttrs ¶
type OperationAttrs []*OperationAttr
func (OperationAttrs) Find ¶
func (a OperationAttrs) Find(name string) interface{}
type RedisClient ¶
type RedisClient struct { Db *redis.Client // 驱动 // contains filtered or unexported fields }
RedisClient https://redis.uptrace.dev/
func NewRedisClient ¶
func NewRedisClient(config *ConfigRedisClient) (*RedisClient, error)
func (*RedisClient) GetDb ¶
func (c *RedisClient) GetDb() *redis.Client
func (*RedisClient) NewListOperation ¶
func (c *RedisClient) NewListOperation() *ListOperation
NewListOperation 列表(list)类型数据操作 https://www.tizi365.com/archives/299.html
func (*RedisClient) NewSimpleCache ¶
func (c *RedisClient) NewSimpleCache(operation *StringOperation, expire time.Duration, serializer string) *SimpleCache
NewSimpleCache 构造函数
func (*RedisClient) NewSimpleInterfaceCache ¶
func (c *RedisClient) NewSimpleInterfaceCache(operation *SimpleOperation, expire time.Duration) *SimpleInterfaceCache
NewSimpleInterfaceCache 构造函数
func (*RedisClient) NewSimpleJsonCache ¶
func (c *RedisClient) NewSimpleJsonCache(operation *StringOperation, expire time.Duration) *SimpleJsonCache
NewSimpleJsonCache 构造函数
func (*RedisClient) NewSimpleOperation ¶
func (c *RedisClient) NewSimpleOperation() *SimpleOperation
func (*RedisClient) NewSimpleStringCache ¶
func (c *RedisClient) NewSimpleStringCache(operation *StringOperation, expire time.Duration) *SimpleStringCache
NewSimpleStringCache 构造函数
func (*RedisClient) NewStringOperation ¶
func (c *RedisClient) NewStringOperation() *StringOperation
type RedisClient6 ¶
type RedisClient6 struct { Db *redis.Client // 驱动 // contains filtered or unexported fields }
RedisClient6 https://redis.uptrace.dev/
func NewRedisClient6 ¶
func NewRedisClient6(config *ConfigRedisClient) (*RedisClient6, error)
NewRedisClient6 Redis 6
func (*RedisClient6) GetDb ¶
func (c *RedisClient6) GetDb() *redis.Client
type RedisClient7 ¶
type RedisClient7 struct { Db *redis.Client // 驱动 // contains filtered or unexported fields }
RedisClient7 https://redis.uptrace.dev/
func NewRedisClient7 ¶
func NewRedisClient7(config *ConfigRedisClient) (*RedisClient7, error)
NewRedisClient7 Redis 7
func (*RedisClient7) GetDb ¶
func (c *RedisClient7) GetDb() *redis.Client
type SimpleCache ¶
type SimpleCache struct { Operation *StringOperation // 操作类 Expire time.Duration // 过去时间 DBGetter DBGttFunc // 缓存不存在的操作 DB JsonGetter JsonGttFunc // 缓存不存在的操作 JSON Serializer string // 序列化方式 }
SimpleCache 缓存
func (*SimpleCache) GetCache ¶
func (c *SimpleCache) GetCache(key string) (ret interface{})
GetCache 获取缓存
func (*SimpleCache) SetCache ¶
func (c *SimpleCache) SetCache(key string, value interface{})
SetCache 设置缓存
type SimpleInterfaceCache ¶
type SimpleInterfaceCache struct { Operation *SimpleOperation // 操作类 Expire time.Duration // 过期时间 DBGetter DBGttInterfaceFunc // 缓存不存在的操作 DB }
SimpleInterfaceCache 缓存
func (*SimpleInterfaceCache) GetCache ¶
func (c *SimpleInterfaceCache) GetCache(key string) (ret interface{})
GetCache 获取缓存
func (*SimpleInterfaceCache) SetCache ¶
func (c *SimpleInterfaceCache) SetCache(key string, value interface{})
SetCache 设置缓存
type SimpleJsonCache ¶
type SimpleJsonCache struct { Operation *StringOperation // 操作类 Expire time.Duration // 过期时间 DBGetter DBGttJsonFunc // 缓存不存在的操作 DB }
SimpleJsonCache 缓存
func (*SimpleJsonCache) GetCache ¶
func (c *SimpleJsonCache) GetCache(key string) (ret interface{})
GetCache 获取缓存
func (*SimpleJsonCache) SetCache ¶
func (c *SimpleJsonCache) SetCache(key string, value interface{})
SetCache 设置缓存
type SimpleOperation ¶
type SimpleOperation struct {
// contains filtered or unexported fields
}
func (*SimpleOperation) Del ¶
func (o *SimpleOperation) Del(keys ...string) *redis.IntCmd
Del 删除key操作,支持批量删除
func (*SimpleOperation) Set ¶
func (o *SimpleOperation) Set(key string, value interface{}, attrs ...*OperationAttr) *SimpleResult
Set 设置
type SimpleResult ¶
type SimpleResult struct { Result interface{} Err error }
func NewSimpleResult ¶
func NewSimpleResult(result interface{}, err error) *SimpleResult
NewSimpleResult 构造函数
func (*SimpleResult) UnwrapOr ¶
func (r *SimpleResult) UnwrapOr(defaults interface{}) interface{}
UnwrapOr 空值情况下设置返回默认值
func (*SimpleResult) UnwrapOrElse ¶
func (r *SimpleResult) UnwrapOrElse(f func() interface{}) interface{}
UnwrapOrElse 空值情况下设置返回其他
type SimpleStringCache ¶
type SimpleStringCache struct { Operation *StringOperation // 操作类 Expire time.Duration // 过期时间 DBGetter DBGttStringFunc // 缓存不存在的操作 DB }
SimpleStringCache 缓存
func (*SimpleStringCache) GetCache ¶
func (c *SimpleStringCache) GetCache(key string) (ret string)
GetCache 获取缓存
func (*SimpleStringCache) SetCache ¶
func (c *SimpleStringCache) SetCache(key string, value string)
SetCache 设置缓存
type SliceResult ¶
type SliceResult struct { Result []interface{} Err error }
func NewSliceResult ¶
func NewSliceResult(result []interface{}, err error) *SliceResult
NewSliceResult 构造函数
func (*SliceResult) Iter ¶
func (r *SliceResult) Iter() *Iterator
func (*SliceResult) UnwrapOr ¶
func (r *SliceResult) UnwrapOr(defaults []interface{}) []interface{}
UnwrapOr 空值情况下设置返回默认值
type StringOperation ¶
type StringOperation struct {
// contains filtered or unexported fields
}
func (*StringOperation) Del ¶
func (o *StringOperation) Del(keys ...string) *redis.IntCmd
Del 删除key操作,支持批量删除
func (*StringOperation) MGet ¶
func (o *StringOperation) MGet(keys ...string) *SliceResult
MGet 获取多个
func (*StringOperation) Set ¶
func (o *StringOperation) Set(key string, value interface{}, attrs ...*OperationAttr) *StringResult
Set 设置
type StringResult ¶
func NewStringResult ¶
func NewStringResult(result string, err error) *StringResult
NewStringResult 构造函数
func (*StringResult) UnwrapOr ¶
func (r *StringResult) UnwrapOr(defaults string) string
UnwrapOr 空值情况下设置返回默认值
func (*StringResult) UnwrapOrElse ¶
func (r *StringResult) UnwrapOrElse(f func() string) string
UnwrapOrElse 空值情况下设置返回其他
type UpperClient ¶
type UpperClient struct {
Db *db.Session // 驱动
}
UpperClient https://upper.io/
func NewUpperCockroachdbClient ¶
func NewUpperCockroachdbClient(settings cockroachdb.ConnectionURL) (*UpperClient, error)
func NewUpperMongodbClient ¶
func NewUpperMongodbClient(settings mongo.ConnectionURL) (*UpperClient, error)
func NewUpperMssqlClient ¶
func NewUpperMssqlClient(settings mssql.ConnectionURL) (*UpperClient, error)
func NewUpperMysqlClient ¶
func NewUpperMysqlClient(settings mysql.ConnectionURL) (*UpperClient, error)
func NewUpperPostgresqlClient ¶
func NewUpperPostgresqlClient(settings postgresql.ConnectionURL) (*UpperClient, error)
func NewUpperQlClient ¶
func NewUpperQlClient(settings ql.ConnectionURL) (*UpperClient, error)
type XormClient ¶
XormClient https://xorm.io/
func NewXormMysqlClient ¶
func NewXormMysqlClient(config *ConfigXormClient) (*XormClient, error)
func NewXormPostgresClient ¶
func NewXormPostgresClient(config *ConfigXormClient) (*XormClient, error)
type XormClientSession ¶
XormClientSession https://xorm.io/zh/docs/chapter-10/readme/
type ZormClient ¶
ZormClient https://zorm.cn/ https://www.yuque.com/u27016943/nrgi00
func NewZormClickhouseClient ¶
func NewZormClickhouseClient(config *ConfigZormClient) (*ZormClient, error)
func NewZormDmClient ¶
func NewZormDmClient(config *ConfigZormClient) (*ZormClient, error)
func NewZormMysqlClient ¶
func NewZormMysqlClient(config *ConfigZormClient) (*ZormClient, error)
Source Files ¶
- beego.go
- beego_mysql.go
- beego_oracle.go
- beego_pgsql.go
- beego_tidb.go
- bun.go
- bun_mssql.go
- bun_mysql.go
- bun_postgresql.go
- gorm.go
- gorm_mysql.go
- gorm_postgresql.go
- gorm_sqlserver.go
- gorm_transaction.go
- mongo.go
- mongo_bson.go
- mongo_curd.go
- mongo_curl_find.go
- mongo_curl_find_many.go
- mongo_curl_find_one.go
- mongo_get.go
- mongo_json.go
- mongo_options.go
- mongo_set.go
- mongo_time.go
- mongo_transaction.go
- mongo_transaction_curd.go
- mongo_transaction_get.go
- mongo_transaction_set.go
- mongo_xml.go
- redis.go
- redis_6.go
- redis_7.go
- redis_Iterator.go
- redis_hash_operation.go
- redis_list_operation.go
- redis_operation_attr.go
- redis_simple_cache.go
- redis_simple_interface_cache.go
- redis_simple_json_cache.go
- redis_simple_operation.go
- redis_simple_result.go
- redis_simple_sring_cache.go
- redis_slice_result.go
- redis_string_operation.go
- redis_string_result.go
- upper.go
- upper_cockroachdb.go
- upper_mongodb.go
- upper_mssql.go
- upper_mysql.go
- upper_postgresql.go
- upper_ql.go
- xorm.go
- xorm_mysql.go
- xorm_postgres.go
- xorm_transaction.go
- zorm.go
- zorm_clickhouse.go
- zorm_dm.go
- zorm_gbase.go
- zorm_kingbase.go
- zorm_mysql.go
- zorm_shentong.go