Help us shape the future of Go! Take the 2026 Go Developer Survey

errstore

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorEvent

type ErrorEvent struct {
	OccurredAt    time.Time
	CorrelationID string
	Method        string
	Path          string
	Endpoint      string
	StatusCode    int
	ErrorCode     string
	Message       string
}

func NewEvent

func NewEvent(now time.Time, correlationID, method, path, endpoint string, statusCode int, errorCode, message string) ErrorEvent

type Filter

type Filter struct {
	Endpoint string
	Limit    int
}

type NoopStore

type NoopStore struct{}

func (NoopStore) List

func (NoopStore) Persist

type PostgresStore

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

func (*PostgresStore) List

func (s *PostgresStore) List(ctx context.Context, filter Filter) ([]ErrorEvent, error)

func (*PostgresStore) Persist

func (s *PostgresStore) Persist(ctx context.Context, event ErrorEvent) error

type Store

type Store interface {
	Persist(context.Context, ErrorEvent) error
	List(context.Context, Filter) ([]ErrorEvent, error)
}

func NewNoopStore

func NewNoopStore() Store

func NewPostgresStore

func NewPostgresStore(pool *pgxpool.Pool) Store

Jump to

Keyboard shortcuts

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