memory

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: 4 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 using a mutex-protected slice.

func NewStore

func NewStore() *Store

NewStore creates a new in-memory webhook store.

func (*Store) Delete

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

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

func (*Store) Get

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

Get returns the config with the given ID, or webhook.ErrNotFound.

func (*Store) List

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

List returns all stored webhook configs.

func (*Store) ListByEvent

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

ListByEvent returns all active configs that subscribe to the given event.

func (*Store) Save

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

Save adds or replaces a webhook config. If cfg.ID is empty a UUID is generated.

Jump to

Keyboard shortcuts

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