Documentation ¶
Index ¶
- type MySQL
- func (m *MySQL) CreateDictionary(d *model.Dictionary) error
- func (m *MySQL) CreateEntry(entry *model.Entry) error
- func (m *MySQL) GetAllDictionaries(source string) ([]model.Dictionary, error)
- func (m *MySQL) GetAllEntries(source string) ([]model.Entry, error)
- func (m *MySQL) GetDayEntries(source string) ([]model.Entry, error)
- func (m *MySQL) GetDictionary(id int) (*model.Dictionary, error)
- func (m *MySQL) GetDictionaryByKeyword(source, keyword string) (model.Dictionary, error)
- func (m *MySQL) GetMonthEntries(source string) ([]model.Entry, error)
- func (m *MySQL) GetWeekEntries(source string) ([]model.Entry, error)
- func (m *MySQL) RemoveDictionary(d *model.Dictionary) error
- func (m *MySQL) RemoveDictionaryBySource(source string) error
- func (m *MySQL) RemoveEntryByKeyword(source, keyword string) error
- func (m *MySQL) RemoveEntryBySource(source string) error
- type MySQLOption
- type Redis
- func (r *Redis) AddKeyword(source, keyword, val string) error
- func (r *Redis) GetDisplayName(userId string) (string, error)
- func (r *Redis) GetKeyword(source, keyword string) (string, error)
- func (r *Redis) RemoveAllKeyword(source string) error
- func (r *Redis) RemoveKeyword(source, keyword string) error
- func (r *Redis) SetDisplayName(userId, name string) error
- type RedisOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MySQL ¶
type MySQL struct {
// contains filtered or unexported fields
}
func NewMySQL ¶
func NewMySQL(opt MySQLOption) (*MySQL, error)
NewMySQL returns a pointer of MySQL instance and error.
func (*MySQL) CreateDictionary ¶
func (m *MySQL) CreateDictionary(d *model.Dictionary) error
func (*MySQL) GetAllDictionaries ¶
func (m *MySQL) GetAllDictionaries(source string) ([]model.Dictionary, error)
func (*MySQL) GetDictionary ¶
func (m *MySQL) GetDictionary(id int) (*model.Dictionary, error)
func (*MySQL) GetDictionaryByKeyword ¶
func (m *MySQL) GetDictionaryByKeyword(source, keyword string) (model.Dictionary, error)
func (*MySQL) GetMonthEntries ¶
func (*MySQL) RemoveDictionary ¶
func (m *MySQL) RemoveDictionary(d *model.Dictionary) error
func (*MySQL) RemoveDictionaryBySource ¶
func (*MySQL) RemoveEntryByKeyword ¶
func (*MySQL) RemoveEntryBySource ¶
type MySQLOption ¶
type MySQLOption struct { User string Password string Host string Port string Database string Charset string }
Option holds all necessary options for database.
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
func NewRedis ¶
func NewRedis(opt RedisOption) (*Redis, error)
func (*Redis) AddKeyword ¶
func (*Redis) GetKeyword ¶
0 not exist, 1 exist, -1 don't know
func (*Redis) RemoveAllKeyword ¶
func (*Redis) RemoveKeyword ¶
func (*Redis) SetDisplayName ¶
Click to show internal directories.
Click to hide internal directories.