conn

package
v0.0.0-...-af8db51 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package conn provides redis connection

Index

Constants

This section is empty.

Variables

View Source
var Pool *redis.Pool

Functions

func CreateDownloadRecord

func CreateDownloadRecord(user, show, se string)

CreateDownloadRecord records user's latest American show download

func CreateMasterId

func CreateMasterId(id int64)

CreateMasterId saves master's id

func CreateMemo

func CreateMemo(user, when, memo string)

CreateMemo saves a memo

func CreateTask

func CreateTask(ts Task)

CreateTask saves a task

func CreateUserChatId

func CreateUserChatId(user string, id int64)

CreateUserChatId saves user's chat id

func DeleteMemo

func DeleteMemo(user string, index int)

DeleteMemo deletes a memo

func DeleteTask

func DeleteTask(ts Task)

DeleteTask deletes a task

func NewPool

func NewPool(server, password string, db int) *redis.Pool

NewPool return a redis pool

func Ping

func Ping(server, password string) bool

Ping tests redis pool connection

func ReadDownloadRecord

func ReadDownloadRecord(user, show string) string

ReadDownloadRecord get latest download record

func ReadMasterId

func ReadMasterId() int64

ReadMasterId read master id in redis

func ReadUserChatId

func ReadUserChatId(user string) int64

ReadUserChatId read user's chat id

func UpdateTaskId

func UpdateTaskId() int

UpdateTaskId auto increases task id

Types

type Memo

type Memo struct {
	Time    string `redis:"time"`
	Content string `redis:"content"`
}

Memo is user's memo

func ReadAllMemos

func ReadAllMemos(user string) []Memo

ReadAllMemo get user's all memos

type Task

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

func ReadAllTasks() []Task

ReadAllTasks load all unfinished task

func ReadUserTasks

func ReadUserTasks(user string) []Task

ReadUserTasks read user's all tasks

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL