Documentation ¶
Index ¶
- Variables
- type Store
- func (s *Store) AddChannel(channel *model.Channel) error
- func (s *Store) AddMessage(message *model.Message) error
- func (s *Store) AddUser(user *model.User) error
- func (s *Store) GetChannels() ([]*model.Channel, error)
- func (s *Store) GetChannelsByIds(ids ...model.Id) ([]*model.Channel, error)
- func (s *Store) GetMessagesByChannelIdAndTimeRange(channelId model.Id, begin, end time.Time, limit int) ([]*model.Message, error)
- func (s *Store) GetMessagesByIds(ids ...model.Id) ([]*model.Message, error)
- func (s *Store) GetUserByHandle(handle string) (*model.User, error)
- func (s *Store) GetUsersByIds(ids ...model.Id) ([]*model.User, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUserHandleExists = fmt.Errorf("user handle exists")
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
Backend keyvaluestore.Backend
}
Store implements the persistence layer of our application.
func (*Store) AddUser ¶
Adds a user to the database. Returns ErrUserHandleExists if the handle is taken.
func (*Store) GetChannelsByIds ¶
func (*Store) GetMessagesByChannelIdAndTimeRange ¶
func (s *Store) GetMessagesByChannelIdAndTimeRange(channelId model.Id, begin, end time.Time, limit int) ([]*model.Message, error)
GetMessagesByChannelIdAndTimeRange gets messages for a particular channel within an inclusive time range. If limit is non-zero, the returned messages will be limited to that number. If limit is negative, the returned messages will be the last messages in the range.
func (*Store) GetMessagesByIds ¶
Click to show internal directories.
Click to hide internal directories.