Documentation ¶
Index ¶
- Constants
- Variables
- func Hash(data []byte) uint64
- type BloomFilter
- type JSON
- type LevelDBDriver
- func (l *LevelDBDriver) Close() error
- func (l *LevelDBDriver) Get(dbName, key string) ([]byte, error)
- func (l *LevelDBDriver) GetArrJson(dbName string, key string) ([]map[string]interface{}, error)
- func (l *LevelDBDriver) GetDB(dbName string) (*goleveldb.DB, error)
- func (l *LevelDBDriver) GetDBName(dbName string) string
- func (l *LevelDBDriver) GetJson(dbName, key string) (map[string]interface{}, error)
- func (l *LevelDBDriver) GetRangeNum(dbName string, start string, end string) (int, error)
- func (l *LevelDBDriver) IterAll(dbName string) error
- func (l *LevelDBDriver) IteratorByPrefix(dbName string, prefix string) (map[string][]byte, error)
- func (l *LevelDBDriver) IteratorByRange(dbName string, start, end string) ([]map[string]interface{}, error)
- func (l *LevelDBDriver) IteratorStrByRange(dbName string, start, end string) ([]map[string]string, error)
- func (l *LevelDBDriver) Put(dbName, key string, value []byte) error
- func (l *LevelDBDriver) Remove(dbName string, start string, end string, nums int) error
- func (l *LevelDBDriver) WriteByArray(dbName string, key string, value interface{}) error
- func (l *LevelDBDriver) WriteJson(dbName string, key string, value interface{}) error
- type PostgresDriver
- func (d *PostgresDriver) CreateEventTrigger(sql, triggerName string) error
- func (d *PostgresDriver) CreateTrigger(sql string, triggerName string) error
- func (d *PostgresDriver) DeleteTrigger(triggerName string) error
- func (d *PostgresDriver) GetPrimary(table interface{}) ([]string, error)
- func (d *PostgresDriver) GetPrimaryWithName(tableName string) ([]string, error)
- func (d *PostgresDriver) GetTableName(table interface{}) string
- func (d *PostgresDriver) InitWithDB(db *gorm.DB) *PostgresDriver
- func (d *PostgresDriver) ListEventTrigger() map[string]bool
- func (d *PostgresDriver) ListTrigger() map[string]bool
- type RedisConfig
- type RedisDriver
- func (d *RedisDriver) BasicGet(key string) interface{}
- func (d *RedisDriver) BasicSet(key string, value interface{}, expir time.Duration, typ actionType) (e error)
- func (d *RedisDriver) NewBitSet(key string, bits uint) *redisBitSet
- func (d *RedisDriver) NewBloomFilter(bits uint, key string) *BloomFilter
- func (d *RedisDriver) NewLock(key string) *RedisLock
- func (d *RedisDriver) Ping() bool
- type RedisLock
Constants ¶
View Source
const ( RedisStr actionType = iota // 字符串类型 RedisList // 列表类型 RedisHash // 哈希类型 RedisSortSet // 排序集合类型 RedisSet // 集合类型 )
Variables ¶
View Source
var ErrTooLargeOffset = errors.New("too large offset")
ErrTooLargeOffset indicates the offset is too large in bitset.
Functions ¶
Types ¶
type BloomFilter ¶
type BloomFilter struct {
// contains filtered or unexported fields
}
布隆过滤器结构体
func (*BloomFilter) Add ¶
func (f *BloomFilter) Add(data []byte) error
type LevelDBDriver ¶
type LevelDBDriver struct {
// contains filtered or unexported fields
}
支持按照文件名返回连接
func NewLevelDBDriver ¶
func NewLevelDBDriver(prefix string) (*LevelDBDriver, error)
func (*LevelDBDriver) Close ¶
func (l *LevelDBDriver) Close() error
func (*LevelDBDriver) GetArrJson ¶
func (l *LevelDBDriver) GetArrJson(dbName string, key string) ([]map[string]interface{}, error)
func (*LevelDBDriver) GetDBName ¶
func (l *LevelDBDriver) GetDBName(dbName string) string
func (*LevelDBDriver) GetJson ¶
func (l *LevelDBDriver) GetJson(dbName, key string) (map[string]interface{}, error)
func (*LevelDBDriver) GetRangeNum ¶
func (*LevelDBDriver) IterAll ¶
func (l *LevelDBDriver) IterAll(dbName string) error
func (*LevelDBDriver) IteratorByPrefix ¶
根据前缀获取key,value
func (*LevelDBDriver) IteratorByRange ¶
func (l *LevelDBDriver) IteratorByRange(dbName string, start, end string) ([]map[string]interface{}, error)
func (*LevelDBDriver) IteratorStrByRange ¶
func (l *LevelDBDriver) IteratorStrByRange(dbName string, start, end string) ([]map[string]string, error)
IteratorStrByRange 按照范围获取key-value
func (*LevelDBDriver) WriteByArray ¶
func (l *LevelDBDriver) WriteByArray(dbName string, key string, value interface{}) error
写入数据 找给定key判断能否找到 能找到的话按照数组的格式往后添加数据
type PostgresDriver ¶
func (*PostgresDriver) CreateEventTrigger ¶
func (d *PostgresDriver) CreateEventTrigger(sql, triggerName string) error
func (*PostgresDriver) CreateTrigger ¶
func (d *PostgresDriver) CreateTrigger(sql string, triggerName string) error
创建触发器是否成功
func (*PostgresDriver) DeleteTrigger ¶
func (d *PostgresDriver) DeleteTrigger(triggerName string) error
func (*PostgresDriver) GetPrimary ¶
func (d *PostgresDriver) GetPrimary(table interface{}) ([]string, error)
func (*PostgresDriver) GetPrimaryWithName ¶
func (d *PostgresDriver) GetPrimaryWithName(tableName string) ([]string, error)
func (*PostgresDriver) GetTableName ¶
func (d *PostgresDriver) GetTableName(table interface{}) string
func (*PostgresDriver) InitWithDB ¶
func (d *PostgresDriver) InitWithDB(db *gorm.DB) *PostgresDriver
func (*PostgresDriver) ListEventTrigger ¶
func (d *PostgresDriver) ListEventTrigger() map[string]bool
func (*PostgresDriver) ListTrigger ¶
func (d *PostgresDriver) ListTrigger() map[string]bool
type RedisConfig ¶
func (RedisConfig) DSN ¶
func (c RedisConfig) DSN() interface{}
type RedisDriver ¶
type RedisDriver struct { Client *redis.Client // contains filtered or unexported fields }
func NewRedisDriver ¶
func NewRedisDriver(config *RedisConfig) (*RedisDriver, error)
NewRedisDriver driver构造函数
func (*RedisDriver) BasicSet ¶
func (d *RedisDriver) BasicSet(key string, value interface{}, expir time.Duration, typ actionType) (e error)
BasicSet 基本数据类型的添加元素
func (*RedisDriver) NewBitSet ¶
func (d *RedisDriver) NewBitSet(key string, bits uint) *redisBitSet
获取bitset数据结构
func (*RedisDriver) NewBloomFilter ¶
func (d *RedisDriver) NewBloomFilter(bits uint, key string) *BloomFilter
布隆过滤器的构造函数
Click to show internal directories.
Click to hide internal directories.