Documentation
¶
Index ¶
- type PostgresStore
- func (s *PostgresStore) Close() error
- func (s *PostgresStore) CreditConsumerBalance(ctx context.Context, consumerID string, amountUSDC float64, reference string) error
- func (s *PostgresStore) CurrentConsumerBalance(ctx context.Context, consumerID string) (float64, error)
- func (s *PostgresStore) FinalizePrepaidCharge(ctx context.Context, consumerID, requestID string, actualChargeUSDC float64, ...) (float64, error)
- func (s *PostgresStore) HeartbeatProvider(ctx context.Context, req gateway.ProviderHeartbeatRequest) error
- func (s *PostgresStore) InsertUsageEvents(ctx context.Context, events []gateway.UsageEvent) (int, error)
- func (s *PostgresStore) ListUsageEvents(ctx context.Context, filter gateway.UsageListFilter) ([]gateway.UsageEvent, error)
- func (s *PostgresStore) LookupActiveAPIKey(ctx context.Context, apiKeyHash string) (*gateway.APIKeyPrincipal, error)
- func (s *PostgresStore) LookupConsumerAPIKeyHash(ctx context.Context, consumerID string) (string, error)
- func (s *PostgresStore) RecordTelemetryBatch(ctx context.Context, gatewayID, batchID, signature string, eventCount int) (bool, error)
- func (s *PostgresStore) RecordX402PrepaidTopup(ctx context.Context, consumerID, paymentFingerprint string, amountUSDC float64) (bool, float64, error)
- func (s *PostgresStore) ReservePrepaidBalance(ctx context.Context, consumerID, requestID string, reserveUSDC float64) (gateway.PrepaidReserveResult, error)
- func (s *PostgresStore) RevokeConsumerAPIKey(ctx context.Context, consumerID, apiKeyHash, reason string) (bool, error)
- func (s *PostgresStore) RotateProviderWallet(ctx context.Context, req gateway.ProviderWalletRotateRequest) error
- func (s *PostgresStore) UpsertConsumerAPIKey(ctx context.Context, ...) error
- func (s *PostgresStore) UpsertProvider(ctx context.Context, req gateway.ProviderRegisterRequest) error
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 (*PostgresStore) CurrentConsumerBalance ¶
func (*PostgresStore) FinalizePrepaidCharge ¶
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 (*PostgresStore) RecordTelemetryBatch ¶
func (*PostgresStore) RecordX402PrepaidTopup ¶
func (*PostgresStore) ReservePrepaidBalance ¶
func (s *PostgresStore) ReservePrepaidBalance(ctx context.Context, consumerID, requestID string, reserveUSDC float64) (gateway.PrepaidReserveResult, error)
func (*PostgresStore) RevokeConsumerAPIKey ¶
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
Click to show internal directories.
Click to hide internal directories.