Documentation
¶
Index ¶
- Constants
- Variables
- func EncodeLink(errStr string) string
- func ErrorCode(c *gin.Context) string
- func ProvideLedgerLister(provider interface{}) fx.Option
- func ProvideStorageDriver(provider interface{}) fx.Option
- func ProvideVersion(provider interface{}) fx.Option
- func ResponseError(c *gin.Context, err error)
- type AccountController
- type BaseController
- type BaseResponse
- type ConfigController
- type ErrorResponse
- type LedgerController
- type LedgerLister
- type LedgerListerFn
- type MappingController
- type ScriptController
- type ScriptResponse
- type TransactionController
- func (ctl *TransactionController) GetTransaction(c *gin.Context)
- func (ctl *TransactionController) GetTransactions(c *gin.Context)
- func (ctl *TransactionController) PostTransaction(c *gin.Context)
- func (ctl *TransactionController) PostTransactionMetadata(c *gin.Context)
- func (ctl *TransactionController) PostTransactionsBatch(c *gin.Context)
- func (ctl *TransactionController) RevertTransaction(c *gin.Context)
Constants ¶
View Source
const ( ErrInternal = "INTERNAL" ErrConflict = "CONFLICT" ErrInsufficientFund = "INSUFFICIENT_FUND" ErrValidation = "VALIDATION" ErrContextCancelled = "CONTEXT_CANCELLED" ErrStore = "STORE" )
View Source
const ( VersionKey = `name:"_apiVersion"` StorageDriverKey = `name:"_apiStorageDriver"` LedgerListerKey = `name:"_apiLedgerLister"` )
Variables ¶
View Source
var Module = fx.Options( fx.Provide( fx.Annotate(NewConfigController, fx.ParamTags(VersionKey, StorageDriverKey, LedgerListerKey)), ), fx.Provide(NewLedgerController), fx.Provide(NewScriptController), fx.Provide(NewAccountController), fx.Provide(NewTransactionController), fx.Provide(NewMappingController), )
Functions ¶
func EncodeLink ¶
func ProvideLedgerLister ¶
func ProvideStorageDriver ¶
func ProvideVersion ¶
func ResponseError ¶ added in v1.0.4
Types ¶
type AccountController ¶
type AccountController struct {
BaseController
}
AccountController -
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 BaseResponse ¶
type BaseResponse struct { Data interface{} `json:"data,omitempty"` Cursor interface{} `json:"cursor,omitempty"` }
type ConfigController ¶
type ConfigController struct { BaseController Version string StorageDriver string LedgerLister LedgerLister }
ConfigController -
func NewConfigController ¶
func NewConfigController(version string, storageDriver string, lister LedgerLister) ConfigController
NewConfigController -
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 ErrorResponse ¶
type LedgerController ¶
type LedgerController struct {
BaseController
}
LedgerController -
func (*LedgerController) GetStats ¶
func (ctl *LedgerController) GetStats(c *gin.Context)
type LedgerLister ¶
type LedgerListerFn ¶
type MappingController ¶
type MappingController struct {
BaseController
}
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 ScriptController ¶
type ScriptController struct {
BaseController
}
ScriptController -
func (*ScriptController) PostScript ¶
func (ctl *ScriptController) PostScript(c *gin.Context)
type ScriptResponse ¶
type ScriptResponse struct { ErrorResponse Link string `json:"details,omitempty"` Transaction *core.Transaction `json:"transaction,omitempty"` }
type TransactionController ¶
type TransactionController struct {
BaseController
}
TransactionController -
func NewTransactionController ¶
func NewTransactionController() TransactionController
NewTransactionController -
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)
Click to show internal directories.
Click to hide internal directories.