filewebhook

package
v1.30.3 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Store)

Option is a functional option for configuring the Store.

func WithFileCache

func WithFileCache(cache *fileutil.Cache[*auth.Webhook]) Option

WithFileCache sets the file cache for webhook objects.

type Store

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

Store implements auth.WebhookStore using the local filesystem. Webhooks are stored as individual JSON files in the configured directory. Thread-safe through internal locking.

func New

func New(baseDir string, opts ...Option) (*Store, error)

New creates a new file-based webhook store. The baseDir must be non-empty; provided Option functions are applied to the store. If baseDir does not exist it is created with directory permissions 0750, and an initial in-memory index is built from existing webhook files.

func (*Store) Create

func (s *Store) Create(_ context.Context, webhook *auth.Webhook) error

Create stores a new webhook.

func (*Store) Delete

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

Delete removes a webhook by its ID.

func (*Store) DeleteByDAGName

func (s *Store) DeleteByDAGName(ctx context.Context, dagName string) error

DeleteByDAGName removes a webhook by its DAG name.

func (*Store) GetByDAGName

func (s *Store) GetByDAGName(ctx context.Context, dagName string) (*auth.Webhook, error)

GetByDAGName retrieves the webhook for a specific DAG.

func (*Store) GetByID

func (s *Store) GetByID(_ context.Context, id string) (*auth.Webhook, error)

GetByID retrieves a webhook by its unique ID.

func (*Store) List

func (s *Store) List(ctx context.Context) ([]*auth.Webhook, error)

List returns all webhooks in the store.

func (*Store) Update

func (s *Store) Update(_ context.Context, webhook *auth.Webhook) error

Update modifies an existing webhook.

func (*Store) UpdateLastUsed

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

UpdateLastUsed updates the LastUsedAt timestamp for a webhook.

Jump to

Keyboard shortcuts

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