Versions in this module Expand all Collapse all v2 v2.3.0 Feb 4, 2024 v2.2.0 Aug 19, 2023 Changes in this version + const CACHE_VALIDITY + const DB_TABLE_TEMPLATES + var CACHE_LOCAL = make(map[int64]map[string][]string) + var TEST_MODE = false + var USER_CACHE = make(map[int64]*UserCacheEntry) + func EnsureApiEnabled(r *Repo, userId int64) error + func GenNonce(digits int) string + func IsGroupChat(m *tb.Message) bool + func LogDbf(r *Repo, level helpers.Level, m *tb.Message, format string, v ...interface{}) + type Repo struct + func NewRepo(db dbWrapper.DB) *Repo + func (r *Repo) AddTemplate(chatId int64, name, template string) error + func (r *Repo) ArchiveTransactions(m *tb.Message) error + func (r *Repo) CreateApiVerification(userId int64) (nonce string, err error) + func (r *Repo) DeleteAllCacheEntries(m *tb.Message) error + func (r *Repo) DeleteAllUserSettings(tgChatId int64) error + func (r *Repo) DeleteCache(m *tb.Message) + func (r *Repo) DeleteCacheEntries(m *tb.Message, t string, value string) (sql.Result, error) + func (r *Repo) DeleteTemplates(m *tb.Message) error + func (r *Repo) DeleteTransaction(m *tb.Message, isArchived bool, elementId int) (int64, error) + func (r *Repo) DeleteTransactions(m *tb.Message) (int64, error) + func (r *Repo) DeleteUser(m *tb.Message) error + func (r *Repo) EnrichUserData(m *tb.Message) error + func (r *Repo) FillCache(m *tb.Message) error + func (r *Repo) GetAllSuggestions(m *tb.Message) (map[string][]string, error) + func (r *Repo) GetCacheHints(m *tb.Message, key string) ([]string, error) + func (r *Repo) GetTemplates(m *tb.Message, name string) ([]*TemplateResult, error) + func (r *Repo) GetTokenChatId(token string) (chatId int64, err error) + func (r *Repo) GetTransactions(m *tb.Message, isArchived bool) ([]*TransactionResult, error) + func (r *Repo) GetUserSetting(setting string, tgChatId int64) (exists bool, val string, err error) + func (r *Repo) GetUsersToNotify() (*sql.Rows, error) + func (r *Repo) HealthGetCacheStats() (accTo, accFrom, txDesc, other int, err error) + func (r *Repo) HealthGetLogs(lastHours int) (errors int, warnings int, err error) + func (r *Repo) HealthGetTransactions() (open int, archived int, err error) + func (r *Repo) HealthGetUserCount() (count int, err error) + func (r *Repo) HealthGetUsersActiveCounts(maxDiffHours int) (count int, err error) + func (r *Repo) IndividualsWithNotifications(chatId string) (recipients []string) + func (r *Repo) PutCacheHints(m *tb.Message, values map[string]string) error + func (r *Repo) RecordTransaction(chatId int64, tx string) error + func (r *Repo) RevokeApiToken(token string) (count int64, err error) + func (r *Repo) RmTemplate(chatId int64, name string) (bool, error) + func (r *Repo) SetUserSetting(setting string, value string, tgChatId int64) (err error) + func (r *Repo) UserGetCurrency(m *tb.Message) string + func (r *Repo) UserGetNotificationSetting(m *tb.Message) (daysDelay, hour int, err error) + func (r *Repo) UserGetTag(m *tb.Message) string + func (r *Repo) UserGetTzOffset(m *tb.Message) (tzOffset int) + func (r *Repo) UserIsAdmin(m *tb.Message) (isAdmin bool) + func (r *Repo) UserSetCurrency(m *tb.Message, currency string) error + func (r *Repo) UserSetNotificationSetting(m *tb.Message, daysDelay, hour int) error + func (r *Repo) UserSetTag(m *tb.Message, tag string) error + func (r *Repo) UserSetTzOffset(m *tb.Message, timezoneOffset int) error + func (r *Repo) VerifyApiToken(userId int64, nonce string) (token string, err error) + type TemplateResult struct + Name string + Template string + type TransactionResult struct + Date string + Id int + Tx string + type User struct + TgChatId int64 + TgUsername string + type UserCacheEntry struct + Expiry time.Time + Value *User Other modules containing this package github.com/LucaBernstein/beancount-bot-tg