Documentation
¶
Overview ¶
Package inbox provides functionality to manage inboxes in the system.
Index ¶
- Constants
- Variables
- type Closer
- type Identifier
- type Inbox
- type Manager
- func (m *Manager) Close()
- func (m *Manager) Create(inbox imodels.Inbox) (imodels.Inbox, error)
- func (m *Manager) Get(id int) (Inbox, error)
- func (m *Manager) GetAll() ([]imodels.Inbox, error)
- func (m *Manager) GetDBRecord(id int) (imodels.Inbox, error)
- func (m *Manager) InitInboxes(initFn initFn) error
- func (m *Manager) Register(i Inbox)
- func (m *Manager) Reload(ctx context.Context, initFn initFn) error
- func (m *Manager) SetMessageStore(store MessageStore)
- func (m *Manager) SetUserStore(store UserStore)
- func (m *Manager) SoftDelete(id int) error
- func (m *Manager) Start(ctx context.Context) error
- func (m *Manager) Toggle(id int) (imodels.Inbox, error)
- func (m *Manager) Update(id int, inbox imodels.Inbox) (imodels.Inbox, error)
- type MessageHandler
- type MessageStore
- type Opts
- type UserStore
Constants ¶
const (
ChannelEmail = "email"
)
Variables ¶
var ( // ErrInboxNotFound is returned when an inbox is not found. ErrInboxNotFound = errors.New("inbox not found") )
Functions ¶
This section is empty.
Types ¶
type Closer ¶
type Closer interface {
Close() error
}
Closer provides a function for closing an inbox.
type Identifier ¶
type Identifier interface {
Identifier() int
}
Identifier provides a method for obtaining a unique identifier for the inbox.
type Inbox ¶
type Inbox interface { Closer Identifier MessageHandler FromAddress() string Channel() string }
Inbox combines the operations of an inbox including its lifecycle, identification, and message handling.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) Get ¶
Get retrieves the initialized inbox instance with the specified ID from memory.
func (*Manager) GetDBRecord ¶
GetDBRecord returns the inbox record from the DB.
func (*Manager) InitInboxes ¶
InitInboxes initializes and registers active inboxes with the manager.
func (*Manager) SetMessageStore ¶
func (m *Manager) SetMessageStore(store MessageStore)
SetMessageStore sets the message store for the manager.
func (*Manager) SetUserStore ¶
SetUserStore sets the user store for the manager.
func (*Manager) SoftDelete ¶
SoftDelete soft deletes an inbox in the DB.
type MessageHandler ¶
MessageHandler defines methods for handling message operations.
type MessageStore ¶
type MessageStore interface { MessageExists(string) (bool, error) EnqueueIncoming(models.IncomingMessage) error }
MessageStore defines methods for storing and processing messages.