Documentation ¶
Overview ¶
Package dbms provides common redis action
Index ¶
- Constants
- Variables
- func CacheDelete(key string)
- func CacheGet(key string) string
- func CacheGetSet(key, newValue string) string
- func CacheSet(key string, value interface{}, px time.Duration)
- func CreateChatIndex(cid int, cPid string)
- func CreateDeviceIndex(uid int, dt string)
- func CreateMissionIndex(mid int, mPid string)
- func CreateProjectIndex(pid int, pPid string)
- func CreateSearchIndex(uid int, info, searchType string)
- func CreateTodoIndex(tid int, tPid string)
- func CreateUserIndex(uid int, uPid string)
- func DeleteSamId(sid string)
- func Get(key string) (string, error)
- func NewDB(user, password, host string, port int, database string) *sql.DB
- func NewPool(server, password string, db string) *redis.Pool
- func ReadChatId(cPid string) (cid int)
- func ReadDeviceToken(uid int) (dt string)
- func ReadIfSamIdExist(sid string) (exist bool)
- func ReadMissionId(mPid string) (mid int)
- func ReadProjectId(pPid string) (pid int)
- func ReadTodoId(tPid string) (tid int)
- func ReadUserId(uPid string) (uid int)
- func ReadUserIdWithIndex(info, loginType string) (uid int)
- func UpdateSamIdSet(sid string)
- func VisitRecord(uid int)
Constants ¶
const ( SearchPhoneIndex = "index:search:phone" SearchMailIndex = "index:search:mail" SearchSamIndex = "index:search:sam" )
const ( //index UserIndex = "index:user" TodoIndex = "index:todo" MissionIndex = "index:mission" ProjectIndex = "index:project" ChatIndex = "index:chat" DeviceIndex = "index:device" )
Variables ¶
var CachePool *redis.Pool
var DB *sql.DB
var Pool *redis.Pool
Functions ¶
func CacheGetSet ¶
CacheGetSet gets a key from the cache db and sets with a new value
func CreateChatIndex ¶
CreateChatIndex creates 'chat public id==>> chat real id' index
func CreateDeviceIndex ¶
CreateDeviceIndex creates 'user real id==>> user device token' index
func CreateMissionIndex ¶
CreateMissionIndex creates 'mission public id==>> mission real id' index
func CreateProjectIndex ¶
CreateProjectIndex creates 'project public id==>> project real id' index
func CreateSearchIndex ¶
CreateSearchIndex creates index from user id, phone/mail/sam id
func CreateTodoIndex ¶
CreateTodoIndex creates 'to-do public id==>> to-do real id' index
func CreateUserIndex ¶
CreateUserIndex creates 'user public id==>> user real id' index
func ReadChatId ¶
ReadProjectId gets project real id with public id
func ReadDeviceToken ¶
ReadDeviceToken gets user device token with real id
func ReadIfSamIdExist ¶
ReadIfSamIdExist tests if the given sam id is in redis db set
func ReadMissionId ¶
ReadMissionId gets mission real id with public id
func ReadProjectId ¶
ReadProjectId gets project real id with public id
func ReadTodoId ¶
ReadTodoId gets to-do real id with public id
func ReadUserId ¶
ReadUserId gets user real id with public id
func ReadUserIdWithIndex ¶
ReadUserIdWithIndex reads user id from redis db with index type
Types ¶
This section is empty.