epstore

package
v1.148.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package epstore is the PostgreSQL store of endpoint bindings and the failed requests they answered (#2171, #2172): the script_endpoints and script_endpoint_failures tables of migration 000203.

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 is the PostgreSQL binding store.

func New

func New(db *sql.DB) *Store

New returns a store over db.

func (*Store) Failures

func (s *Store) Failures(ctx context.Context, endpointID string, limit int) ([]epbinding.Failure, error)

Failures returns an endpoint's most recent failed requests, newest first.

func (*Store) Get

func (s *Store) Get(ctx context.Context, scriptID string) (*epbinding.Binding, error)

Get returns a script's binding.

func (*Store) GetByName

func (s *Store) GetByName(ctx context.Context, name string) (*epbinding.Binding, error)

GetByName returns the binding a name serves.

func (*Store) List

func (s *Store) List(ctx context.Context, filter epbinding.Filter) ([]epbinding.Binding, error)

List returns bindings matching the filter, by name.

func (*Store) RecordFailure

func (s *Store) RecordFailure(ctx context.Context, f epbinding.Failure) error

RecordFailure keeps one failed request.

func (*Store) Set

func (s *Store) Set(ctx context.Context, b *epbinding.Binding) error

Set creates or replaces a script's binding, keyed by its script, keeping the id and creation stamp of the one it replaces.

func (*Store) SetEnabled

func (s *Store) SetEnabled(ctx context.Context, scriptID string, enabled bool, actor string) error

SetEnabled turns a script's binding on or off.

func (*Store) Stamp

func (s *Store) Stamp(ctx context.Context, name string) (epbinding.Stamp, error)

Stamp reads when the binding a name serves and its script were last written.

func (*Store) SweepFailures

func (s *Store) SweepFailures(ctx context.Context, cutoff time.Time) (int64, error)

SweepFailures deletes the failures recorded before cutoff.

Jump to

Keyboard shortcuts

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