postgres

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store implements webhook.Store against PostgreSQL.

func NewStore

func NewStore(pool *pgxpool.Pool) *Store

NewStore creates a Store backed by the given pool.

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, id string) error

Delete removes the webhook config with the given ID. Returns webhook.ErrNotFound if no row exists.

func (*Store) Get

func (s *Store) Get(ctx context.Context, id string) (*webhook.Config, error)

Get returns the webhook config with the given ID. Returns webhook.ErrNotFound if no row exists.

func (*Store) List

func (s *Store) List(ctx context.Context) ([]webhook.Config, error)

List returns all stored webhook configs.

func (*Store) ListByEvent

func (s *Store) ListByEvent(ctx context.Context, event string) ([]webhook.Config, error)

ListByEvent returns all active webhook configs subscribed to the given event.

func (*Store) Save

func (s *Store) Save(ctx context.Context, cfg *webhook.Config) error

Save inserts or replaces a webhook config. If cfg.ID is empty, a new UUID is generated and written back to cfg.ID.

Jump to

Keyboard shortcuts

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