controllers

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: MIT Imports: 20 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	MaxPageSize     = 1000
	DefaultPageSize = ledger.QueryDefaultPageSize

	QueryKeyCursor = "cursor"
	// Deprecated
	QueryKeyCursorDeprecated = "pagination_token"

	QueryKeyPageSize = "pageSize"
	// Deprecated
	QueryKeyPageSizeDeprecated = "page_size"

	QueryKeyBalanceOperator = "balanceOperator"
	// Deprecated
	QueryKeyBalanceOperatorDeprecated = "balance_operator"

	QueryKeyStartTime = "startTime"
	// Deprecated
	QueryKeyStartTimeDeprecated = "start_time"

	QueryKeyEndTime = "endTime"
	// Deprecated
	QueryKeyEndTimeDeprecated = "end_time"
)

Variables

View Source
var (
	ErrInvalidPageSize = ledger.NewValidationError("invalid 'pageSize' query param")
	// Deprecated
	ErrInvalidPageSizeDeprecated = ledger.NewValidationError("invalid 'page_size' query param")

	ErrInvalidBalanceOperator = ledger.NewValidationError(
		"invalid parameter 'balanceOperator', should be one of 'e, ne, gt, gte, lt, lte'")
	// Deprecated
	ErrInvalidBalanceOperatorDeprecated = ledger.NewValidationError(
		"invalid parameter 'balance_operator', should be one of 'e, ne, gt, gte, lt, lte'")

	ErrInvalidStartTime = ledger.NewValidationError("invalid 'startTime' query param")
	// Deprecated
	ErrInvalidStartTimeDeprecated = ledger.NewValidationError("invalid 'start_time' query param")

	ErrInvalidEndTime = ledger.NewValidationError("invalid 'endTime' query param")
	// Deprecated
	ErrInvalidEndTimeDeprecated = ledger.NewValidationError("invalid 'end_time' query param")
)

Functions

func ProvideVersion

func ProvideVersion(provider interface{}) fx.Option

Types

type AccountController

type AccountController struct{}

func NewAccountController

func NewAccountController() AccountController

func (*AccountController) CountAccounts added in v1.3.2

func (ctl *AccountController) CountAccounts(c *gin.Context)

func (*AccountController) GetAccount

func (ctl *AccountController) GetAccount(c *gin.Context)

func (*AccountController) GetAccounts

func (ctl *AccountController) GetAccounts(c *gin.Context)

func (*AccountController) PostAccountMetadata

func (ctl *AccountController) PostAccountMetadata(c *gin.Context)

type BalanceController added in v1.6.0

type BalanceController struct{}

func NewBalanceController added in v1.6.0

func NewBalanceController() BalanceController

func (*BalanceController) GetBalances added in v1.6.0

func (ctl *BalanceController) GetBalances(c *gin.Context)

func (*BalanceController) GetBalancesAggregated added in v1.6.0

func (ctl *BalanceController) GetBalancesAggregated(c *gin.Context)

type Config added in v1.3.2

type Config struct {
	LedgerStorage *LedgerStorage `json:"storage"`
}

type ConfigController

type ConfigController struct {
	Version       string
	StorageDriver storage.Driver[ledger.Store]
}

func NewConfigController

func NewConfigController(version string, storageDriver storage.Driver[ledger.Store]) ConfigController

func (*ConfigController) GetDocsAsJSON

func (ctl *ConfigController) GetDocsAsJSON(c *gin.Context)

func (*ConfigController) GetDocsAsYaml

func (ctl *ConfigController) GetDocsAsYaml(c *gin.Context)

func (*ConfigController) GetInfo

func (ctl *ConfigController) GetInfo(c *gin.Context)

type ConfigInfo added in v1.3.2

type ConfigInfo struct {
	Server  string      `json:"server"`
	Version interface{} `json:"version"`
	Config  *Config     `json:"config"`
}

type Info added in v1.9.0

type Info struct {
	Name    string      `json:"name"`
	Storage storageInfo `json:"storage"`
}

type LedgerController

type LedgerController struct{}

func NewLedgerController

func NewLedgerController() LedgerController

func (*LedgerController) GetInfo added in v1.9.0

func (ctl *LedgerController) GetInfo(c *gin.Context)

func (*LedgerController) GetLogs added in v1.9.0

func (ctl *LedgerController) GetLogs(c *gin.Context)

func (*LedgerController) GetStats

func (ctl *LedgerController) GetStats(c *gin.Context)

type LedgerStorage added in v1.3.2

type LedgerStorage struct {
	Driver  string   `json:"driver"`
	Ledgers []string `json:"ledgers"`
}

type MappingController

type MappingController struct{}

func NewMappingController

func NewMappingController() MappingController

func (*MappingController) GetMapping

func (ctl *MappingController) GetMapping(c *gin.Context)

func (*MappingController) PutMapping

func (ctl *MappingController) PutMapping(c *gin.Context)

type PostTransaction added in v1.9.0

type PostTransaction struct {
	Postings  core.Postings `json:"postings"`
	Script    core.Script   `json:"script"`
	Timestamp time.Time     `json:"timestamp"`
	Reference string        `json:"reference"`
	Metadata  core.Metadata `json:"metadata" swaggertype:"object"`
}

type ScriptController

type ScriptController struct{}

func NewScriptController

func NewScriptController() ScriptController

func (*ScriptController) PostScript

func (ctl *ScriptController) PostScript(c *gin.Context)

type ScriptResponse

type ScriptResponse struct {
	api.ErrorResponse
	Transaction *core.ExpandedTransaction `json:"transaction,omitempty"`
}

type TransactionController

type TransactionController struct{}

func NewTransactionController

func NewTransactionController() TransactionController

func (*TransactionController) CountTransactions added in v1.3.2

func (ctl *TransactionController) CountTransactions(c *gin.Context)

func (*TransactionController) GetTransaction

func (ctl *TransactionController) GetTransaction(c *gin.Context)

func (*TransactionController) GetTransactions

func (ctl *TransactionController) GetTransactions(c *gin.Context)

func (*TransactionController) PostTransaction

func (ctl *TransactionController) PostTransaction(c *gin.Context)

func (*TransactionController) PostTransactionMetadata

func (ctl *TransactionController) PostTransactionMetadata(c *gin.Context)

func (*TransactionController) PostTransactionsBatch

func (ctl *TransactionController) PostTransactionsBatch(c *gin.Context)

func (*TransactionController) RevertTransaction

func (ctl *TransactionController) RevertTransaction(c *gin.Context)

Jump to

Keyboard shortcuts

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