Documentation
¶
Index ¶
- Variables
- type Channel
- type ID
- type KeyEnvelope
- type Message
- type Repository
- type Service
- func (s *Service) CreateChannel(ctx context.Context, userID user.ID, nameEnc string) (Channel, error)
- func (s *Service) DeleteChannel(ctx context.Context, userID user.ID, channelID ID) error
- func (s *Service) GetChannel(ctx context.Context, userID user.ID, channelID ID) (Channel, error)
- func (s *Service) GetKeyEnvelope(ctx context.Context, userID user.ID, channelID ID, deviceID device.ID) (KeyEnvelope, error)
- func (s *Service) ListChannels(ctx context.Context, userID user.ID) ([]Channel, error)
- func (s *Service) ListMessages(ctx context.Context, userID user.ID, channelID ID, limit int) ([]Message, error)
- func (s *Service) UpdateChannelName(ctx context.Context, userID user.ID, channelID ID, nameEnc string) (Channel, error)
- func (s *Service) UpsertKeyEnvelope(ctx context.Context, userID user.ID, env KeyEnvelope) error
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type KeyEnvelope ¶
type Repository ¶
type Repository interface {
CreateChannel(ctx context.Context, ch Channel) error
GetChannel(ctx context.Context, id ID) (Channel, error)
ListChannels(ctx context.Context) ([]Channel, error)
UpdateChannelName(ctx context.Context, id ID, nameEnc string) error
DeleteChannel(ctx context.Context, id ID) error
SaveMessage(ctx context.Context, msg Message) error
ListRecentMessages(ctx context.Context, channelID ID, limit int) ([]Message, error)
UpsertKeyEnvelope(ctx context.Context, env KeyEnvelope) error
GetKeyEnvelope(ctx context.Context, channelID ID, deviceID device.ID) (KeyEnvelope, error)
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repo Repository, users *user.Service) *Service
func (*Service) CreateChannel ¶
func (*Service) DeleteChannel ¶
func (*Service) GetChannel ¶
func (*Service) GetKeyEnvelope ¶
func (*Service) ListChannels ¶
func (*Service) ListMessages ¶
func (*Service) UpdateChannelName ¶
func (*Service) UpsertKeyEnvelope ¶
Click to show internal directories.
Click to hide internal directories.