Documentation ¶
Index ¶
- Constants
- Variables
- func AddMessage(msg *model.Message) error
- func ExistUser(appleID string) (string, error)
- func GetAllDevice(userID string) ([]*model.Device, error)
- func GetAllPushKey(userID string) ([]*model.PushKey, error)
- func GetBarkDevice(key, token string) (*model.BarkDevice, error)
- func GetBarkToken(deviceKey string) string
- func GetDevice(id int64) (*model.Device, error)
- func GetMessages(userID string, offset, count int) ([]*model.Message, error)
- func GetPushKey(id int64, name, pushKey string) (*model.PushKey, error)
- func GetPushKeyInfo(pushKey string) (*model.PushKey, error)
- func GetStruct(key string, v interface{}) error
- func GetUser(uid, appleID string) (*model.User, error)
- func GetUserIDStr(token string) (string, error)
- func InitBoltDB() (err error)
- func InitPostgresDB() error
- func InitRedis() error
- func InsertBarkDevice(key, token string) error
- func InsertDevice(device *model.Device) error
- func InsertPushKey(key *model.PushKey) error
- func InsertUser(appleID, email, name, uuid string) error
- func RemoveDevice(id string) error
- func RemoveKey(kid string) error
- func RemoveMessage(id string) error
- func SetStruct(key string, v interface{}) error
- func UpdateDeviceName(id int64, newName string) error
- func UpdatePushKey(keyID int64, newName, newKey string) error
Constants ¶
View Source
const ( UserTable = "t_user" DeviceTable = "t_device" PushKeyTable = "t_push_key" MessageTable = "t_message" BarkDeviceTable = "t_bark_device" )
Variables ¶
View Source
var TableCreateMap = map[string]func(ctx context.Context, db *sql.DB) error{ UserTable: createUserTable, DeviceTable: createDeviceTable, PushKeyTable: createPushKeyTable, MessageTable: createMessageTable, BarkDeviceTable: createBarkDeviceTable, }
Functions ¶
func AddMessage ¶
func GetBarkDevice ¶
func GetBarkDevice(key, token string) (*model.BarkDevice, error)
func GetBarkToken ¶
func GetUserIDStr ¶
func InitBoltDB ¶
func InitBoltDB() (err error)
func InitPostgresDB ¶
func InitPostgresDB() error
func InsertBarkDevice ¶
func InsertDevice ¶
func InsertPushKey ¶
func InsertUser ¶
func RemoveDevice ¶
func RemoveMessage ¶
func UpdateDeviceName ¶
func UpdatePushKey ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.