Documentation
¶
Overview ¶
Package message provides CRUD operations for persisting daemon messages.
Plane: manager
Index ¶
- type Channel
- type Contact
- type CreateParams
- type Service
- func (s *Service) AddAttachment(ctx context.Context, messageID uuid.UUID, filename, mimeType, path string, ...) (*ent.Attachment, error)
- func (s *Service) AddReaction(ctx context.Context, messageID uuid.UUID, emoji, from string) (*ent.Reaction, error)
- func (s *Service) Create(ctx context.Context, p CreateParams) (*ent.Message, error)
- func (s *Service) ListAgentFeed(ctx context.Context, userName string, limit, offset int) ([]*ent.Message, error)
- func (s *Service) ListContacts(ctx context.Context, userID string) ([]Contact, error)
- func (s *Service) ListConversation(ctx context.Context, userA, userB string, limit, offset int) ([]*ent.Message, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateParams ¶
type CreateParams struct {
Sender string
Recipient string
Content string
Team string
Channel Channel
Runtime *runtime.Runtime // nil for human messages
}
CreateParams holds parameters for creating a message.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service wraps the Ent client for message persistence operations.
func NewService ¶
NewService creates a new message Service.
func (*Service) AddAttachment ¶
func (s *Service) AddAttachment( ctx context.Context, messageID uuid.UUID, filename, mimeType, path string, size int64, ) (*ent.Attachment, error)
AddAttachment attaches a file to a message.
func (*Service) AddReaction ¶
func (s *Service) AddReaction(ctx context.Context, messageID uuid.UUID, emoji, from string) (*ent.Reaction, error)
AddReaction attaches an emoji reaction to a message.
func (*Service) ListAgentFeed ¶
func (s *Service) ListAgentFeed(ctx context.Context, userName string, limit, offset int) ([]*ent.Message, error)
ListAgentFeed returns agent-to-agent messages (neither sent nor received by userName), newest first.
func (*Service) ListContacts ¶
ListContacts returns the conversation partners of a user, ordered by most recent message.
Click to show internal directories.
Click to hide internal directories.