client

package
v0.0.0-...-dc3c4d4 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: MIT Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BillingClient

type BillingClient struct {
	*BillingClientConfig
	// contains filtered or unexported fields
}

BillingClient client for billing

func NewBillingClient

func NewBillingClient(conf BillingClientConfig) (*BillingClient, error)

func (*BillingClient) Bill

func (c *BillingClient) Bill(
	ctx context.Context, resourceId string, dryRun bool, apikey string) (*service.BillingReceipt, error)

func (*BillingClient) BillBatch

func (c *BillingClient) BillBatch(
	ctx context.Context, resourceUses map[string]int64, dryRun bool, apikey string) (*service.BillingBatchReceipt, error)

type BillingClientConfig

type BillingClientConfig struct {
	Gateway    string        // API gateway endpoint
	BillingKey string        // billing auth key
	PingTest   bool          // test ping gateway?
	Timeout    time.Duration `default:"200ms"` // request timeout, default 200ms
}

type VipInfo

type VipInfo = contract.ICardTrackerVipInfo

type VipSubscriptionClient

type VipSubscriptionClient struct {
	*web3go.Client
	*VipSubscriptionClientConfig
	// contains filtered or unexported fields
}

VipSubscriptionClient client to get VIP subscription info

func (*VipSubscriptionClient) GetVipSubscriptionInfo

func (c *VipSubscriptionClient) GetVipSubscriptionInfo(apiKey string) (*types.VipInfo, error)

type VipSubscriptionClientConfig

type VipSubscriptionClientConfig struct {
	*web3go.ClientOption

	ChainRpcUrl          string        // blockchain network RPC endpoint
	AppContract          string        // App contract address
	VipInfoCacheSize     int           `default:"5000"` // VIP info cache size
	VipInfoExpirationTTL time.Duration `default:"15m"`  // VIP info cache expiration time
}

Directories

Path Synopsis
Package jsonrpc provides a JSON-RPC 2.0 client that sends JSON-RPC requests and receives JSON-RPC responses using HTTP.
Package jsonrpc provides a JSON-RPC 2.0 client that sends JSON-RPC requests and receives JSON-RPC responses using HTTP.

Jump to

Keyboard shortcuts

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