Documentation
¶
Index ¶
- type SQLiteStore
- func (s *SQLiteStore) Close() error
- func (s *SQLiteStore) DeleteExpiredWebhooks() (deletedCount int, err error)
- func (s *SQLiteStore) GetMessagePageForWebhook(webhookID string, page int, pageSize int, outcome model.MessageOutcome) (messagePage *model.MessagePage, err error)
- func (s *SQLiteStore) GetWebhook(id string) (*model.Webhook, error)
- func (s *SQLiteStore) InsertMessage(webhookID string, message *model.Message) (err error)
- func (s *SQLiteStore) InsertWebhook(webhook *model.Webhook) (string, error)
- func (s *SQLiteStore) ListWebhooks() (webhooks []*model.Webhook, err error)
- type WebhookNotFoundError
- type WebhookStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SQLiteStore ¶
type SQLiteStore struct {
// contains filtered or unexported fields
}
SQLiteStore persists webhooks and messages in SQLite.
func NewSQLiteStore ¶
func NewSQLiteStore(path string, encryptionKey string) (*SQLiteStore, error)
NewSQLiteStore creates or loads a SQLite-backed store.
func (*SQLiteStore) Close ¶
func (s *SQLiteStore) Close() error
Close releases the underlying database resources.
func (*SQLiteStore) DeleteExpiredWebhooks ¶
func (s *SQLiteStore) DeleteExpiredWebhooks() (deletedCount int, err error)
DeleteExpiredWebhooks removes expired webhooks and their captured messages.
func (*SQLiteStore) GetMessagePageForWebhook ¶
func (s *SQLiteStore) GetMessagePageForWebhook(webhookID string, page int, pageSize int, outcome model.MessageOutcome) (messagePage *model.MessagePage, err error)
GetMessagePageForWebhook retrieves a page of messages for given webhook ID.
func (*SQLiteStore) GetWebhook ¶
func (s *SQLiteStore) GetWebhook(id string) (*model.Webhook, error)
GetWebhook retrieves webhook with given ID.
func (*SQLiteStore) InsertMessage ¶
func (s *SQLiteStore) InsertMessage(webhookID string, message *model.Message) (err error)
InsertMessage inserts message for given webhook ID.
func (*SQLiteStore) InsertWebhook ¶
func (s *SQLiteStore) InsertWebhook(webhook *model.Webhook) (string, error)
InsertWebhook inserts provided webhooks.
func (*SQLiteStore) ListWebhooks ¶
func (s *SQLiteStore) ListWebhooks() (webhooks []*model.Webhook, err error)
ListWebhooks lists all stored webhooks in reverse creation order.
type WebhookNotFoundError ¶
type WebhookNotFoundError struct {
WebhookId string
}
WebhookNotFoundError indicates that a webhook does not exist.
func (*WebhookNotFoundError) Error ¶
func (e *WebhookNotFoundError) Error() string
Error implements the error interface.
type WebhookStorage ¶
type WebhookStorage interface {
InsertWebhook(webhook *model.Webhook) (string, error)
GetWebhook(id string) (*model.Webhook, error)
ListWebhooks() ([]*model.Webhook, error)
InsertMessage(webhookID string, message *model.Message) error
GetMessagePageForWebhook(webhookID string, page int, pageSize int, outcome model.MessageOutcome) (*model.MessagePage, error)
}
WebhookStorage stores webhooks and captured messages.