Documentation ¶
Index ¶
- Variables
- func NewRestServer(prefix string, db *Database) (e *echo.Echo)
- type App
- type Database
- func (p *Database) Close()
- func (p *Database) CreateOrGetUserKeyByTelegramId(u *User) bool
- func (p *Database) GetTimer(id, userid int64) *Timer
- func (p *Database) GetTimersJSON(userid int64) string
- func (p *Database) GetUserIdByKey(key string) (id int64, err error)
- func (p *Database) GetUserTelegramIdById(id int64) (tgid int64, err error)
- func (p *Database) Init()
- func (p *Database) NewTimer() *Timer
- func (p *Database) ProcessExpiredTimers() int
- type Timer
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var InitTelegram = initTelegram
Mock points for testing
View Source
var SendTelegramMsg = sendTelegramMsg
View Source
var StartTelegram = startTelegram
View Source
var Tg *tb.Bot = nil
View Source
var TgLoginURL string
Functions ¶
Types ¶
type App ¶
func (*App) Initialize ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func NewDatabase ¶
func (*Database) CreateOrGetUserKeyByTelegramId ¶
func (*Database) GetTimersJSON ¶
func (*Database) GetUserIdByKey ¶
User entries
func (*Database) GetUserTelegramIdById ¶
func (*Database) ProcessExpiredTimers ¶
type Timer ¶
type Timer struct { // Values in database Id int64 `json:"timerid"` UserId int64 `json:"-"` Name string `json:"name" form:"name" query:"name"` Interval int64 `json:"interval" form:"interval" query:"interval"` Expiry int64 `json:"expiry"` // State can be "new", "running", "expired" State string `json:"state"` // Other Database *Database `json:"-"` }
Click to show internal directories.
Click to hide internal directories.