Documentation ¶
Index ¶
- type BoltDB
- func (b *BoltDB) AddChat(id string) error
- func (b *BoltDB) AddUser(chatID string, alias string, user string) error
- func (b *BoltDB) DeleteGroup(chatID string, alias string) error
- func (b *BoltDB) DeleteUserFromGroup(chatID string, alias string, user string) error
- func (b *BoltDB) FindAliases(chatID string, aliases []string) ([]string, error)
- func (b *BoltDB) GetGroup(chatID string, alias string) ([]string, error)
- func (b *BoltDB) GetGroups(chatID string) (map[string][]string, error)
- func (b *BoltDB) PutGroup(chatID string, alias string, users []string) error
- type MockStore
- func (_m *MockStore) AddChat(id string) error
- func (_m *MockStore) AddUser(chatID string, alias string, user string) error
- func (_m *MockStore) DeleteGroup(chatID string, alias string) error
- func (_m *MockStore) DeleteUserFromGroup(chatID string, alias string, user string) error
- func (_m *MockStore) FindAliases(chatID string, aliases []string) ([]string, error)
- func (_m *MockStore) GetGroup(chatID string, alias string) ([]string, error)
- func (_m *MockStore) GetGroups(chatID string) (map[string][]string, error)
- func (_m *MockStore) PutGroup(chatID string, alias string, users []string) error
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoltDB ¶
type BoltDB struct {
// contains filtered or unexported fields
}
BoltDB implements store to put and get groups with specific alias
func (*BoltDB) DeleteGroup ¶
DeleteGroup removes group from the database by given chatID
func (*BoltDB) DeleteUserFromGroup ¶
DeleteUserFromGroup removes user from the group
func (*BoltDB) FindAliases ¶
FindAliases looks for group aliases in the database and returns members of groups if group alias is present
type MockStore ¶
MockStore is an autogenerated mock type for the Store type
func (*MockStore) DeleteGroup ¶
DeleteGroup provides a mock function with given fields: chatID, alias
func (*MockStore) DeleteUserFromGroup ¶
DeleteUserFromGroup provides a mock function with given fields: chatID, alias, user
func (*MockStore) FindAliases ¶
FindAliases provides a mock function with given fields: chatID, aliases
type Store ¶
type Store interface { PutGroup(chatID string, alias string, users []string) (err error) AddUser(chatID string, alias string, user string) (err error) GetGroup(chatID string, alias string) (users []string, err error) GetGroups(chatID string) (groups map[string][]string, err error) DeleteUserFromGroup(chatID string, alias string, user string) (err error) DeleteGroup(chatID string, alias string) (err error) FindAliases(chatID string, aliases []string) (users []string, err error) AddChat(id string) (err error) }
Store defines methods to store and fetch user groups
Click to show internal directories.
Click to hide internal directories.