types

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package types defines custom types for the db package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GatewayEnvelopeBatch

type GatewayEnvelopeBatch struct {
	Envelopes []GatewayEnvelopeRow
}

func NewGatewayEnvelopeBatch

func NewGatewayEnvelopeBatch() *GatewayEnvelopeBatch

func (*GatewayEnvelopeBatch) Add

func (b *GatewayEnvelopeBatch) Add(envelope GatewayEnvelopeRow)

func (*GatewayEnvelopeBatch) All

func (*GatewayEnvelopeBatch) LastSequenceID

func (b *GatewayEnvelopeBatch) LastSequenceID() int64

func (*GatewayEnvelopeBatch) Len

func (b *GatewayEnvelopeBatch) Len() int

func (*GatewayEnvelopeBatch) Reset

func (b *GatewayEnvelopeBatch) Reset()

func (*GatewayEnvelopeBatch) ToParamsV2 added in v1.3.0

type GatewayEnvelopeRow

type GatewayEnvelopeRow struct {
	OriginatorNodeID     int32
	OriginatorSequenceID int64
	Topic                []byte
	// Payer IDs considerations:
	//   - if not 0, they must exist.
	//   - if 0, they are treated as null, as it's nullable in gateway_envelopes_meta.
	//   - if 0, no unsettled usage is incremented.
	PayerID            int32
	GatewayTime        time.Time
	Expiry             int64
	OriginatorEnvelope []byte
	SpendPicodollars   int64
	CountUsage         bool // track unsettled usage for this envelope
	CountCongestion    bool // track originator congestion for this envelope
}

GatewayEnvelopeRow represents a single envelope to be inserted in a batch.

Jump to

Keyboard shortcuts

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