service

package
v0.0.0-...-1380781 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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) CreateEntry

func (m *MySQL) CreateEntry(entry *model.Entry) error

func (*MySQL) GetAllDictionaries

func (m *MySQL) GetAllDictionaries(source string) ([]model.Dictionary, error)

func (*MySQL) GetAllEntries

func (m *MySQL) GetAllEntries(source string) ([]model.Entry, error)

func (*MySQL) GetDayEntries

func (m *MySQL) GetDayEntries(source string) ([]model.Entry, 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 (m *MySQL) GetMonthEntries(source string) ([]model.Entry, error)

func (*MySQL) GetWeekEntries

func (m *MySQL) GetWeekEntries(source string) ([]model.Entry, error)

func (*MySQL) RemoveDictionary

func (m *MySQL) RemoveDictionary(d *model.Dictionary) error

func (*MySQL) RemoveDictionaryBySource

func (m *MySQL) RemoveDictionaryBySource(source string) error

func (*MySQL) RemoveEntryByKeyword

func (m *MySQL) RemoveEntryByKeyword(source, keyword string) error

func (*MySQL) RemoveEntryBySource

func (m *MySQL) RemoveEntryBySource(source string) error

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 (r *Redis) AddKeyword(source, keyword, val string) error

func (*Redis) GetDisplayName

func (r *Redis) GetDisplayName(userId string) (string, error)

func (*Redis) GetKeyword

func (r *Redis) GetKeyword(source, keyword string) (string, error)

0 not exist, 1 exist, -1 don't know

func (*Redis) RemoveAllKeyword

func (r *Redis) RemoveAllKeyword(source string) error

func (*Redis) RemoveKeyword

func (r *Redis) RemoveKeyword(source, keyword string) error

func (*Redis) SetDisplayName

func (r *Redis) SetDisplayName(userId, name string) error

type RedisOption

type RedisOption struct {
	Host     string
	Port     string
	Password string
	Database int
}

Option holds all necessary options for Redis

Jump to

Keyboard shortcuts

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