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

postgres

package
v0.4.5 Latest Latest
Warning

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

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

Documentation

Overview

Package postgres provides an opt-in metadata persistence adapter for diagnostics. It never stores diagnostic package bytes or ciphertext.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidStore  = errors.New("invalid diagnostics PostgreSQL store")
	ErrInvalidRecord = errors.New("invalid diagnostics metadata record")
	ErrNotFound      = diagnostics.ErrNotFound
	ErrLeaseConflict = errors.New("diagnostics lease conflict")
	ErrStateConflict = errors.New("diagnostics state conflict")
)

Functions

func ValidateRecord

func ValidateRecord(r diagnostics.Record) error

Types

type Store

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

func New

func New(db *sql.DB) (*Store, error)

func Open

func Open(ctx context.Context, dsn string) (*Store, error)

func (*Store) AppendOutbox

func (s *Store) AppendOutbox(ctx context.Context, o diagnostics.Outbox) error

func (*Store) Cancel

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

func (*Store) Claim

func (s *Store) Claim(ctx context.Context, worker string, lease time.Duration) (*diagnostics.Record, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) Get

func (s *Store) Get(ctx context.Context, id string) (diagnostics.Record, error)

func (*Store) MarkOutboxDelivered

func (s *Store) MarkOutboxDelivered(ctx context.Context, eventID, worker string) error

MarkOutboxDelivered records delivery state without touching upload metadata.

func (*Store) Migrate

func (s *Store) Migrate(ctx context.Context) error

func (*Store) PendingOutbox

func (s *Store) PendingOutbox(ctx context.Context, limit int) ([]diagnostics.Outbox, error)

func (*Store) Put

func (*Store) Retry

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

Jump to

Keyboard shortcuts

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