Discover Packages
github.com/evolsnow/robot
conn
package
Version:
v0.0.0-...-af8db51
Opens a new window with list of versions in this module.
Published: Oct 24, 2017
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Jump to ...
Documentation
Overview
Index
Constants
Variables
Functions
CreateDownloadRecord(user, show, se)
CreateMasterId(id)
CreateMemo(user, when, memo)
CreateTask(ts)
CreateUserChatId(user, id)
DeleteMemo(user, index)
DeleteTask(ts)
NewPool(server, password, db)
Ping(server, password)
ReadDownloadRecord(user, show)
ReadMasterId()
ReadUserChatId(user)
UpdateTaskId()
Types
Source Files
Documentation
Documentation
¶
Package conn provides redis connection
Variables
func CreateDownloadRecord(user, show, se string)
func CreateMasterId(id int64)
func CreateMemo(user, when, memo string)
func CreateTask(ts Task)
func CreateUserChatId(user string, id int64)
func DeleteMemo(user string, index int)
func DeleteTask(ts Task)
func NewPool(server, password string, db int) *redis.Pool
func Ping(server, password string) bool
func ReadDownloadRecord(user, show string) string
func ReadMasterId() int64
func ReadUserChatId(user string) int64
func UpdateTaskId() int
type Memo
type Task
func CreateDownloadRecord(user, show, se string )
CreateDownloadRecord records user's latest American show download
func CreateMasterId(id int64 )
CreateMasterId saves master's id
func CreateMemo(user, when, memo string )
CreateMemo saves a memo
CreateUserChatId saves user's chat id
DeleteMemo deletes a memo
DeleteTask deletes a task
NewPool return a redis pool
Ping tests redis pool connection
ReadDownloadRecord get latest download record
func ReadMasterId() int64
ReadMasterId read master id in redis
ReadUserChatId read user's chat id
UpdateTaskId auto increases task id
type Memo struct {
Time string `redis:"time"`
Content string `redis:"content"`
}
Memo is user's memo
ReadAllMemo get user's all memos
type Task struct {
Id int `redis:"id"`
ChatId int64 `redis:"chatID"`
Owner string `redis:"owner"`
Desc string `redis:"content"`
When string `redis:"time"`
}
Task is user's task
func ReadAllTasks() []Task
ReadAllTasks load all unfinished task
ReadUserTasks read user's all tasks
Source Files
¶
Click to show internal directories.
Click to hide internal directories.