creditdriver

package
v1.0.0-beta.85 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultLedgerQueryLimit specifies how many entries to return by default for credit related queries
	DefaultLedgerQueryLimit = 1000

	// MaxLedgerQueryLimit specifies the maximum number of entries to return for credit related queries
	MaxLedgerQueryLimit = 1000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GetLedgerBalaceHandlerParams

type GetLedgerBalaceHandlerParams struct {
	LedgerID    api.LedgerID
	QueryParams api.GetLedgerBalanceParams
}

type GetLedgerBalanceRequest

type GetLedgerBalanceRequest struct {
	LedgerID credit.NamespacedLedgerID
	Cutline  time.Time
}

type GetLedgerHistoryRequest

type GetLedgerHistoryRequest struct {
	api.GetLedgerHistoryParams
	// Namespace is filled by the request encoder
	Namespace string
	LedgerID  api.LedgerID
}

type GrantPathParams

type GrantPathParams struct {
	LedgerID api.LedgerID
	GrantID  api.LedgerGrantID
}

type Handlers

type Handlers struct {
	GetFeature    GetFeatureHandler
	ListFeatures  ListFeaturesHandler
	CreateFeature CreateFeatureHandler
	DeleteFeature DeleteFeatureHandler

	// Ledger
	CreateLedger     CreateLedgerHandler
	ListLedgers      ListLedgersHandler
	GetLedgerHistory GetLedgerHistoryHandler

	// Reset
	ResetLedger ResetLedgerHandler

	// Grant
	ListLedgerGrants         ListLedgerGrantsHandler
	ListLedgerGrantsByLedger ListLedgerGrantsByLedgerHandler
	CreateLedgerGrant        CreateLedgerGrantHandler
	VoidLedgerGrant          VoidLedgerGrantHandler
	GetLedgerGrant           GetLedgerGrantHandler

	// Balances
	GetLedgerBalance GetLedgerBalanceHandler
}

func New

func New(
	creditConnector credit.Connector,
	meterRepository meter.Repository,
	namespaceDecoder namespacedriver.NamespaceDecoder,
	options ...httptransport.HandlerOption,
) Handlers

type ListLedgerGrantsByLedgerParams

type ListLedgerGrantsByLedgerParams struct {
	LedgerID credit.LedgerID
	Params   api.ListLedgerGrantsByLedgerParams
}

Jump to

Keyboard shortcuts

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