controllers

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: MIT Imports: 19 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 (
	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

Functions

func EncodeLink(errStr string) string

func ErrorCode added in v1.0.4

func ErrorCode(c *gin.Context) string

func ProvideLedgerLister

func ProvideLedgerLister(provider interface{}) fx.Option

func ProvideStorageDriver

func ProvideStorageDriver(provider interface{}) fx.Option

func ProvideVersion

func ProvideVersion(provider interface{}) fx.Option

func ResponseError added in v1.0.4

func ResponseError(c *gin.Context, err error)

Types

type AccountController

type AccountController struct {
	BaseController
}

AccountController -

func NewAccountController

func NewAccountController() AccountController

NewAccountController -

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 BaseController

type BaseController struct{}

Controllers struct

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 ErrorResponse struct {
	ErrorCode    string `json:"error_code,omitempty"`
	ErrorMessage string `json:"error_message,omitempty"`
}

type LedgerController

type LedgerController struct {
	BaseController
}

LedgerController -

func NewLedgerController

func NewLedgerController() LedgerController

NewLedgerController -

func (*LedgerController) GetStats

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

type LedgerLister

type LedgerLister interface {
	List(r *http.Request) []string
}

type LedgerListerFn

type LedgerListerFn func(r *http.Request) []string

func (LedgerListerFn) List

func (fn LedgerListerFn) List(r *http.Request) []string

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 NewScriptController

func NewScriptController() ScriptController

NewScriptController -

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)

Jump to

Keyboard shortcuts

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