dataplane

package
v0.0.0-...-5a7895e Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresStore

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

func OpenPostgresStore

func OpenPostgresStore(dsn string, maxOpen, maxIdle, connMaxLifetimeSec int) (*PostgresStore, error)

func (*PostgresStore) Close

func (s *PostgresStore) Close() error

func (*PostgresStore) CreditConsumerBalance

func (s *PostgresStore) CreditConsumerBalance(ctx context.Context, consumerID string, amountUSDC float64, reference string) error

func (*PostgresStore) CurrentConsumerBalance

func (s *PostgresStore) CurrentConsumerBalance(ctx context.Context, consumerID string) (float64, error)

func (*PostgresStore) FinalizePrepaidCharge

func (s *PostgresStore) FinalizePrepaidCharge(ctx context.Context, consumerID, requestID string, actualChargeUSDC float64, success bool) (float64, error)

func (*PostgresStore) HeartbeatProvider

func (s *PostgresStore) HeartbeatProvider(ctx context.Context, req gateway.ProviderHeartbeatRequest) error

func (*PostgresStore) InsertUsageEvents

func (s *PostgresStore) InsertUsageEvents(ctx context.Context, events []gateway.UsageEvent) (int, error)

func (*PostgresStore) ListUsageEvents

func (s *PostgresStore) ListUsageEvents(ctx context.Context, filter gateway.UsageListFilter) ([]gateway.UsageEvent, error)

func (*PostgresStore) LookupActiveAPIKey

func (s *PostgresStore) LookupActiveAPIKey(ctx context.Context, apiKeyHash string) (*gateway.APIKeyPrincipal, error)

func (*PostgresStore) LookupConsumerAPIKeyHash

func (s *PostgresStore) LookupConsumerAPIKeyHash(ctx context.Context, consumerID string) (string, error)

func (*PostgresStore) RecordTelemetryBatch

func (s *PostgresStore) RecordTelemetryBatch(ctx context.Context, gatewayID, batchID, signature string, eventCount int) (bool, error)

func (*PostgresStore) RecordX402PrepaidTopup

func (s *PostgresStore) RecordX402PrepaidTopup(ctx context.Context, consumerID, paymentFingerprint string, amountUSDC float64) (bool, float64, error)

func (*PostgresStore) ReservePrepaidBalance

func (s *PostgresStore) ReservePrepaidBalance(ctx context.Context, consumerID, requestID string, reserveUSDC float64) (gateway.PrepaidReserveResult, error)

func (*PostgresStore) RevokeConsumerAPIKey

func (s *PostgresStore) RevokeConsumerAPIKey(ctx context.Context, consumerID, apiKeyHash, reason string) (bool, error)

func (*PostgresStore) RotateProviderWallet

func (s *PostgresStore) RotateProviderWallet(ctx context.Context, req gateway.ProviderWalletRotateRequest) error

func (*PostgresStore) UpsertConsumerAPIKey

func (s *PostgresStore) UpsertConsumerAPIKey(ctx context.Context, consumerID, walletAddress, consumerType, apiKeyHash string) error

func (*PostgresStore) UpsertProvider

func (s *PostgresStore) UpsertProvider(ctx context.Context, req gateway.ProviderRegisterRequest) error

Jump to

Keyboard shortcuts

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