Documentation
¶
Index ¶
- Constants
- Variables
- func PropertyType(key string) byte
- func SessionMarshaller() ([]byte, error)
- type Session
- func (s *Session) Get(key string) (string, error)
- func (s *Session) IgnoreChat(chatID int64) bool
- func (s *Session) IsChatIgnored(chatID int64) bool
- func (s *Session) Set(key string, value string) (string, error)
- func (s *Session) TimezoneToLocation() *time.Location
- func (s *Session) ToMap() map[string]string
- func (s *Session) UnignoreChat(chatID int64) bool
- type SessionsMap
- type SessionsYamlDB
Constants ¶
View Source
const ( PropertyTypeUnknown byte = iota PropertyTypeString PropertyTypeBool )
Variables ¶
View Source
var ConfigKeys = []string{
"timezone",
"keeponline",
"rawmessages",
"asciiarrows",
"oobmode",
"carbons",
"hideids",
"receipts",
"nativeedits",
"ignoregroupdeletions",
}
Functions ¶
func PropertyType ¶ added in v1.10.2
PropertyType determines the property type
func SessionMarshaller ¶
SessionMarshaller implementation for YamlDB
Types ¶
type Session ¶
type Session struct {
Login string `yaml:":login"`
Timezone string `yaml:":timezone"`
KeepOnline bool `yaml:":keeponline"`
RawMessages bool `yaml:":rawmessages"`
AsciiArrows bool `yaml:":asciiarrows"`
OOBMode bool `yaml:":oobmode"`
Carbons bool `yaml:":carbons"`
HideIds bool `yaml:":hideids"`
Receipts bool `yaml:":receipts"`
NativeEdits bool `yaml:":nativeedits"`
IgnoredChats []int64 `yaml:":ignoredchats"`
IgnoreGroupDeletions bool `yaml:":ignoregroupdeletions"`
// contains filtered or unexported fields
}
Session is a key-values subtree
func (*Session) IgnoreChat ¶ added in v1.9.4
IgnoreChat adds a chat id to ignore list, returns false if already ignored
func (*Session) IsChatIgnored ¶ added in v1.9.4
IsChatIgnored checks the chat id against the ignore list
func (*Session) TimezoneToLocation ¶
TimezoneToLocation tries to convert config timezone to location
func (*Session) UnignoreChat ¶ added in v1.9.4
UnignoreChat removes a chat id from ignore list, returns false if not already ignored
type SessionsMap ¶
SessionsMap is for :sessions: subtree
type SessionsYamlDB ¶
type SessionsYamlDB struct {
yamldb.YamlDB
Data *SessionsMap
}
SessionsYamlDB wraps YamlDB with Session
func LoadSessions ¶
func LoadSessions(path string) (*SessionsYamlDB, error)
LoadSessions restores TDlib sessions from the previous run
Click to show internal directories.
Click to hide internal directories.