Documentation ¶
Index ¶
- func New(settings ISettings)
- type Cache
- func (p *Cache) AddRecord(newRec interface{}) error
- func (p *Cache) GetChatInfo(chatID int64) (*raw.ChatInfo, error)
- func (p *Cache) GetChatUser(userID int) (*raw.ChatUser, error)
- func (p *Cache) GetHandlerRecords(out interface{}) error
- func (p *Cache) Init(url string) error
- func (p *Cache) UpdateRecord(newRec interface{}) error
- type ICache
- type ISettings
- type ISettingsOpener
- type ISettingsReader
- type ISettingsWriter
- type Settings
- func (p *Settings) AddRecord(newRec interface{}) error
- func (p *Settings) GetChatInfo(chatID int64) (*raw.ChatInfo, error)
- func (p *Settings) GetChatUser(userID int) (*raw.ChatUser, error)
- func (p *Settings) GetHandlerRecords(out interface{}) error
- func (p *Settings) Init(url string) error
- func (p *Settings) UpdateRecord(newRec interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache - cached info. High-level Settings Manager.
func (*Cache) GetChatInfo ¶
GetChatInfo -
func (*Cache) GetChatUser ¶
GetChatUser -
func (*Cache) GetHandlerRecords ¶
GetHandlerRecords - should we cache this?
type ISettings ¶
type ISettings interface { ISettingsOpener ISettingsReader ISettingsWriter }
ISettings - repository
type ISettingsOpener ¶
ISettingsOpener - access settings
type ISettingsReader ¶
type ISettingsReader interface { GetChatInfo(chatID int64) (*raw.ChatInfo, error) GetChatUser(userID int) (*raw.ChatUser, error) // get all db entries, related to a definite handler (e.g. settings for a Handler) // Mapping interface{} to struct is up to handler GetHandlerRecords(out interface{}) error }
ISettingsReader - readonly access
type ISettingsWriter ¶
type ISettingsWriter interface { AddRecord(newRec interface{}) error UpdateRecord(modifiedRec interface{}) error }
ISettingsWriter - add new entries
type Settings ¶
type Settings struct {
// contains filtered or unexported fields
}
Settings - one settings manager for gorm postgres db. ISettings impl
func (*Settings) GetChatInfo ¶
GetChatInfo -
func (*Settings) GetChatUser ¶
GetChatUser -
func (*Settings) GetHandlerRecords ¶
GetHandlerRecords -
func (*Settings) UpdateRecord ¶
UpdateRecord - update existing
Click to show internal directories.
Click to hide internal directories.