Documentation
¶
Index ¶
- func ToSecond(second int64) time.Duration
- type Cache
- type Field
- type FieldMeta
- type FieldType
- type IndexMeta
- type ListObject
- type Object
- type PageSearchResult
- type RedisCache
- func (this *RedisCache) Add(key string, value Object)
- func (this *RedisCache) AddToMap(key string, subkey string, value Object)
- func (this *RedisCache) Get(key string, result Object) bool
- func (this *RedisCache) GetAsList(key string, typeTemplate Object) ListObject
- func (this *RedisCache) GetAsMap(key string, typeTemplate Object) map[string]Object
- func (this *RedisCache) Init(addr string, pwd string, db int)
- func (this *RedisCache) Set(key string, value Object)
- func (this *RedisCache) SetEx(key string, extime int64)
- func (this *RedisCache) SetNx(key string, value Object, extime int64)
- type RedisLock
- type RedisLockFactory
- type RedisSessionStore
- func (this *RedisSessionStore) Create(id string)
- func (this *RedisSessionStore) Delete(id string)
- func (this *RedisSessionStore) Exist(id string) bool
- func (this *RedisSessionStore) GetValue(id, key string) interface{}
- func (this *RedisSessionStore) Init(addr string, db int, pwd string, expire int64)
- func (this *RedisSessionStore) InitByCluster(addr []string, pwd string, expire int64)
- func (this *RedisSessionStore) SetValue(id, key string, value interface{})
- func (this *RedisSessionStore) Touch(id string)
- type SearchEngine
- func (this *SearchEngine) BeginSafeFlush(name string)
- func (this *SearchEngine) CreateIndex(name string) *searchIndex
- func (this *SearchEngine) EndSafeFlush(name string)
- func (this *SearchEngine) Fetch(name, id string) *SourceObject
- func (this *SearchEngine) FetchByPage(request string, page int64) *PageSearchResult
- func (this *SearchEngine) FlushIndex(name string)
- func (this *SearchEngine) Init(option SearchOption)
- func (this *SearchEngine) LoadSource(name string, obj *SourceObject)
- func (this *SearchEngine) RemoveBySearch(name string, input ...Field)
- func (this *SearchEngine) RemoveKeyword(name, field, word string)
- func (this *SearchEngine) RemoveSource(name string, obj *SourceObject)
- func (this *SearchEngine) Search(name string, input ...Field) *PageSearchResult
- type SearchOption
- type SourceObject
- type TargetObject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache interface { //获取缓存对象,如果存在返回true Get(key string, result Object) bool //设置缓存对象 Set(key string, value Object) //设置缓存对象,并设置过期时间 SetNx(key string, value Object, extime int64) //获取列表 GetAsList(key string, typeTemplate Object) ListObject //向列表中添加对象 Add(key string, value Object) //获取map GetAsMap(key string, typeTemplate Object) map[string]Object //向map中添加对象 AddToMap(key string, subkey string, value Object) //设置过期时间 SetEx(key string, extime int64) }
type ListObject ¶
type ListObject []interface{}
type PageSearchResult ¶
type PageSearchResult struct { Id string `json:"uuid"` //查询的请求id Index int64 `json:"page"` //页码 Data []TargetObject `json:"result"` }
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
func (*RedisCache) AddToMap ¶
func (this *RedisCache) AddToMap(key string, subkey string, value Object)
向map中添加对象
func (*RedisCache) Get ¶
func (this *RedisCache) Get(key string, result Object) bool
获取缓存对象,如果存在返回true
func (*RedisCache) GetAsList ¶
func (this *RedisCache) GetAsList(key string, typeTemplate Object) ListObject
获取列表
type RedisLockFactory ¶
type RedisLockFactory struct {
// contains filtered or unexported fields
}
func (*RedisLockFactory) Create ¶
func (this *RedisLockFactory) Create(r string) *RedisLock
type RedisSessionStore ¶
type RedisSessionStore struct {
// contains filtered or unexported fields
}
分布式session存储实现
func (*RedisSessionStore) Create ¶
func (this *RedisSessionStore) Create(id string)
func (*RedisSessionStore) Delete ¶
func (this *RedisSessionStore) Delete(id string)
func (*RedisSessionStore) Exist ¶
func (this *RedisSessionStore) Exist(id string) bool
func (*RedisSessionStore) GetValue ¶
func (this *RedisSessionStore) GetValue(id, key string) interface{}
func (*RedisSessionStore) Init ¶
func (this *RedisSessionStore) Init(addr string, db int, pwd string, expire int64)
func (*RedisSessionStore) InitByCluster ¶
func (this *RedisSessionStore) InitByCluster(addr []string, pwd string, expire int64)
func (*RedisSessionStore) SetValue ¶
func (this *RedisSessionStore) SetValue(id, key string, value interface{})
func (*RedisSessionStore) Touch ¶
func (this *RedisSessionStore) Touch(id string)
type SearchEngine ¶
type SearchEngine struct {
// contains filtered or unexported fields
}
func (*SearchEngine) BeginSafeFlush ¶
func (this *SearchEngine) BeginSafeFlush(name string)
开始安全flush
func (*SearchEngine) CreateIndex ¶
func (this *SearchEngine) CreateIndex(name string) *searchIndex
创建索引
func (*SearchEngine) EndSafeFlush ¶
func (this *SearchEngine) EndSafeFlush(name string)
结束安全flush,自动替换掉查询用的索引
func (*SearchEngine) Fetch ¶
func (this *SearchEngine) Fetch(name, id string) *SourceObject
func (*SearchEngine) FetchByPage ¶
func (this *SearchEngine) FetchByPage(request string, page int64) *PageSearchResult
按页获取数据
func (*SearchEngine) Init ¶
func (this *SearchEngine) Init(option SearchOption)
func (*SearchEngine) LoadSource ¶
func (this *SearchEngine) LoadSource(name string, obj *SourceObject)
加载和刷新数据
func (*SearchEngine) RemoveBySearch ¶
func (this *SearchEngine) RemoveBySearch(name string, input ...Field)
根据查询条件删除数据,只支持单个条件很正向条件的索引字段删除,数据删除支持搜索删除
func (*SearchEngine) RemoveKeyword ¶
func (this *SearchEngine) RemoveKeyword(name, field, word string)
删除索引中的某个词条
func (*SearchEngine) RemoveSource ¶
func (this *SearchEngine) RemoveSource(name string, obj *SourceObject)
删除数据
func (*SearchEngine) Search ¶
func (this *SearchEngine) Search(name string, input ...Field) *PageSearchResult
type SearchOption ¶
type SourceObject ¶
type SourceObject struct { TargetObject Fields map[string][]string `json:"fields"` }
type TargetObject ¶
type TargetObject struct { Id string `json:"id"` Data json.RawMessage `json:"data"` }
Click to show internal directories.
Click to hide internal directories.