Documentation ¶
Index ¶
- func MustTargets(tgts []bot.Target, err error) []bot.Target
- type Storage
- func (s *Storage) AddTarget(id, login string) (bool, error)
- func (s *Storage) CachedID(login string) (id string, err error)
- func (s *Storage) Config(id string) (cfg map[string]string, err error)
- func (s *Storage) Parted(login string) error
- func (s *Storage) Reconfigure(id, login string, applycfg map[string]string) (prevlogin string, cfg map[string]string, err error)
- func (s *Storage) RemoveTarget(login string) (bool, error)
- func (s *Storage) RenameTarget(prev, next string) (bool, error)
- func (s *Storage) StoreConfig(id string, conf map[string]string) (bool, error)
- func (s *Storage) StoreUserID(login, id string) error
- func (s *Storage) Targets() ([]bot.Target, error)
- func (s *Storage) UserID(login string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Storage ¶
type Storage struct { LoginSet string Login2ID string ID2Login string // contains filtered or unexported fields }
func (*Storage) AddTarget ¶
AddTarget activates a user.
func (*Storage) Reconfigure ¶
func (*Storage) RemoveTarget ¶
RemoveTarget deactivates a user. Configuration is retained.
func (*Storage) RenameTarget ¶
RenameTarget renames a target name, preserving the original configuration.
func (*Storage) StoreConfig ¶
StoreConfig creates or updates the configuration of a target. Keys not set in `conf` are not modified.
func (*Storage) StoreUserID ¶
StoreUserID syncs the ID for a given login. Intended for cases where we know the login, but didn't know the ID yet.
func (*Storage) Targets ¶
Targets returns a list of active logins so that they can be joined on TMI when the bot starts. Note that there is no guarantee the logins are still up to date at that point in time.
Click to show internal directories.
Click to hide internal directories.