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

postgres

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 11 Imported by: 1

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