storage

package
v0.0.0-...-9149657 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL