billing

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifySignature

func VerifySignature(publicKey ed25519.PublicKey, request interface{}, signature string) error

Used on server, provided for testing.

Types

type WorkflowClient

type WorkflowClient interface {
	// Reads
	GetAccountCredits(ctx context.Context, req *pb.GetAccountCreditsRequest) (*pb.GetAccountCreditsResponse, error)
	BatchGetCreditsForAccounts(ctx context.Context, req *pb.BatchGetCreditsForAccountsRequest) (*pb.BatchGetCreditsForAccountsResponse, error)

	// Workflow-based credit ops
	ReserveCredits(ctx context.Context, req *pb.ReserveCreditsRequest) (*pb.ReserveCreditsResponse, error)
	ReleaseReservation(ctx context.Context, req *pb.ReleaseReservationRequest) (*pb.ReleaseReservationResponse, error)
	ConsumeCredits(ctx context.Context, req *pb.ConsumeCreditsRequest) (*pb.ConsumeCreditsResponse, error)
	ConsumeReservation(ctx context.Context, req *pb.ConsumeReservationRequest) (*pb.ConsumeReservationResponse, error)

	// Workflow receipt
	SubmitWorkflowReceipt(ctx context.Context, req *pb.SubmitWorkflowReceiptRequest) (*pb.SubmitWorkflowReceiptResponse, error)

	// Closer
	Close() error
}

WorkflowClient is a specialized interface for the Workflow node use-case.

func NewWorkflowClient

func NewWorkflowClient(address string, opts ...WorkflowClientOpt) (WorkflowClient, error)

type WorkflowClientOpt

type WorkflowClientOpt func(*workflowConfig)

func WithServerName

func WithServerName(name string) WorkflowClientOpt

WithServerName allows overriding the expected server name in the TLS certificate.

func WithServerPublicKey

func WithServerPublicKey(pub ed25519.PublicKey) WorkflowClientOpt

func WithSigningKey

func WithSigningKey(signingKey ed25519.PrivateKey) WorkflowClientOpt

func WithWorkflowLogger

func WithWorkflowLogger(l logger.Logger) WorkflowClientOpt

func WithWorkflowTLSCert

func WithWorkflowTLSCert(cert string) WorkflowClientOpt

func WithWorkflowTransportCredentials

func WithWorkflowTransportCredentials(creds credentials.TransportCredentials) WorkflowClientOpt

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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