Documentation
¶
Index ¶
- Constants
- Variables
- type Conversation
- type Message
- type Person
- type Repository
- type Service
- func (s *Service) Conversation(ctx context.Context, viewerID, conversationID string) (Conversation, []Message, error)
- func (s *Service) Conversations(ctx context.Context, viewerID string) ([]Conversation, error)
- func (s *Service) FamilyMembers(ctx context.Context, viewerID string) ([]Person, error)
- func (s *Service) Send(ctx context.Context, viewerID, conversationID, body string) (Message, error)
- func (s *Service) StartDirect(ctx context.Context, viewerID, recipientID string) (string, error)
Constants ¶
View Source
const ( MaxMessageRunes = 4000 DefaultPageSize = 100 )
Variables ¶
View Source
var ( ErrInvalidMessage = errors.New("invalid message") ErrConversationGone = errors.New("conversation not found") )
Functions ¶
This section is empty.
Types ¶
type Conversation ¶
type Repository ¶
type Repository interface {
FamilyMembers(context.Context, string) ([]Person, error)
CreateDirectConversation(context.Context, string, string, string, time.Time) (string, error)
ConversationsForViewer(context.Context, string, int) ([]Conversation, error)
ConversationForViewer(context.Context, string, string) (Conversation, error)
MessagesForViewer(context.Context, string, string, int) ([]Message, error)
CreateMessage(context.Context, Message) (Message, error)
MarkConversationRead(context.Context, string, string, time.Time) error
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repository Repository) *Service
func (*Service) Conversation ¶
func (*Service) Conversations ¶
func (*Service) FamilyMembers ¶
Click to show internal directories.
Click to hide internal directories.