postgres

package module
v0.1.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const Schema = `` /* 1034-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DB             *sql.DB
	Scope          string
	LimitMicros    int64
	Currency       cost.Currency
	ReservationTTL time.Duration
}

type Ledger

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

func New

func New(cfg Config) *Ledger

func (*Ledger) EnsureSchema

func (l *Ledger) EnsureSchema(ctx context.Context) error

func (*Ledger) Record

func (l *Ledger) Record(ctx context.Context, event cost.Event) error

func (*Ledger) Reserve

func (l *Ledger) Reserve(ctx context.Context, estimate int64) (cost.Reservation, error)

Jump to

Keyboard shortcuts

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