Documentation ¶
Overview ¶
Package routes provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.13.4 DO NOT EDIT.
Index ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func RegisterHandlers(router EchoRouter, si ServerInterface)
- func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
- func StartWebServer(port string, routesImplementation StrictServerInterface, logger Logger) error
- type Account
- type AccountSuccess
- type AccountSuccessJSONResponse
- type AccountsSuccess
- type AccountsSuccessJSONResponse
- type Amount
- type Code
- type Controller
- func (c Controller) Healthz(ctx context.Context, request HealthzRequestObject) (HealthzResponseObject, error)
- func (c Controller) OwnerAccount(ctx context.Context, request OwnerAccountRequestObject) (OwnerAccountResponseObject, error)
- func (c Controller) OwnerAccounts(ctx context.Context, request OwnerAccountsRequestObject) (OwnerAccountsResponseObject, error)
- func (c Controller) OwnerTransactions(ctx context.Context, request OwnerTransactionsRequestObject) (OwnerTransactionsResponseObject, error)
- func (c Controller) Readyz(ctx context.Context, request ReadyzRequestObject) (ReadyzResponseObject, error)
- func (c Controller) Redeem(ctx context.Context, request RedeemRequestObject) (RedeemResponseObject, error)
- func (c Controller) Transfer(ctx context.Context, request TransferRequestObject) (TransferResponseObject, error)
- type Counterparty
- type EchoRouter
- type Error
- type ErrorResponse
- type ErrorResponseJSONResponse
- type HealthSuccess
- type HealthSuccessJSONResponse
- type Healthz200JSONResponse
- type Healthz503JSONResponse
- type HealthzRequestObject
- type HealthzResponseObject
- type Id
- type Logger
- type OperationsAPI
- type OwnerAccount200JSONResponse
- type OwnerAccountParams
- type OwnerAccountRequestObject
- type OwnerAccountResponseObject
- type OwnerAccountdefaultJSONResponse
- type OwnerAccounts200JSONResponse
- type OwnerAccountsRequestObject
- type OwnerAccountsResponseObject
- type OwnerAccountsdefaultJSONResponse
- type OwnerTransactions200JSONResponse
- type OwnerTransactionsRequestObject
- type OwnerTransactionsResponseObject
- type OwnerTransactionsdefaultJSONResponse
- type Readyz200JSONResponse
- type Readyz503JSONResponse
- type ReadyzRequestObject
- type ReadyzResponseObject
- type Redeem200JSONResponse
- type RedeemJSONRequestBody
- type RedeemRequest
- type RedeemRequestObject
- type RedeemResponseObject
- type RedeemSuccess
- type RedeemSuccessJSONResponse
- type RedeemdefaultJSONResponse
- type ServerInterface
- type ServerInterfaceWrapper
- func (w *ServerInterfaceWrapper) Healthz(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) OwnerAccount(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) OwnerAccounts(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) OwnerTransactions(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) Readyz(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) Redeem(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) Transfer(ctx echo.Context) error
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type TransactionRecord
- type TransactionsSuccess
- type TransactionsSuccessJSONResponse
- type Transfer200JSONResponse
- type TransferJSONRequestBody
- type TransferRequest
- type TransferRequestObject
- type TransferResponseObject
- type TransferSuccess
- type TransferSuccessJSONResponse
- type TransferdefaultJSONResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
func PathToRawSpec ¶
Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
func RegisterHandlers ¶
func RegisterHandlers(router EchoRouter, si ServerInterface)
RegisterHandlers adds each server route to the EchoRouter.
func RegisterHandlersWithBaseURL ¶
func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.
func StartWebServer ¶
func StartWebServer(port string, routesImplementation StrictServerInterface, logger Logger) error
Start web server on the main thread. It exits the application if it fails setting up.
Types ¶
type Account ¶
type Account struct { // Balance balance in base units for each currency Balance []Amount `json:"balance"` // Id account id as registered at the Certificate Authority Id string `json:"id"` }
Account Information about an account and its balance
type AccountSuccess ¶
type AccountSuccess struct { Message string `json:"message"` // Payload Information about an account and its balance Payload Account `json:"payload"` }
AccountSuccess defines model for AccountSuccess.
type AccountsSuccess ¶
AccountsSuccess defines model for AccountsSuccess.
type Amount ¶
type Amount struct { // Code the code of the token Code string `json:"code"` // Value value in base units (usually cents) Value int64 `json:"value"` }
Amount The amount to issue, transfer or redeem.
type Controller ¶
type Controller struct {
Service service.TokenService
}
func (Controller) Healthz ¶
func (c Controller) Healthz(ctx context.Context, request HealthzRequestObject) (HealthzResponseObject, error)
(GET /healthz)
func (Controller) OwnerAccount ¶
func (c Controller) OwnerAccount(ctx context.Context, request OwnerAccountRequestObject) (OwnerAccountResponseObject, error)
Get an account and their balances (GET /owner/accounts/{id})
func (Controller) OwnerAccounts ¶
func (c Controller) OwnerAccounts(ctx context.Context, request OwnerAccountsRequestObject) (OwnerAccountsResponseObject, error)
Get all accounts on this node and their balances (GET /owner/accounts)
func (Controller) OwnerTransactions ¶
func (c Controller) OwnerTransactions(ctx context.Context, request OwnerTransactionsRequestObject) (OwnerTransactionsResponseObject, error)
Get all transactions for an account (GET /owner/accounts/{id}/transactions)
func (Controller) Readyz ¶
func (c Controller) Readyz(ctx context.Context, request ReadyzRequestObject) (ReadyzResponseObject, error)
(GET /readyz)
func (Controller) Redeem ¶
func (c Controller) Redeem(ctx context.Context, request RedeemRequestObject) (RedeemResponseObject, error)
Redeem (burn) tokens (POST /owner/accounts/{id}/redeem)
func (Controller) Transfer ¶
func (c Controller) Transfer(ctx context.Context, request TransferRequestObject) (TransferResponseObject, error)
Transfer tokens to another account (POST /owner/accounts/{id}/transfer)
type Counterparty ¶
type Counterparty struct { Account string `json:"account"` // Node The node that holds the recipient account Node string `json:"node"` }
Counterparty The counterparty in a Transfer or Issuance transaction.
type EchoRouter ¶
type EchoRouter interface { CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route }
This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration
type Error ¶
type Error struct { // Message High level error message Message string `json:"message"` // Payload Details about the error Payload string `json:"payload"` }
Error defines model for Error.
type ErrorResponseJSONResponse ¶
type ErrorResponseJSONResponse Error
type HealthSuccess ¶
type HealthSuccess struct { // Message ok Message string `json:"message"` }
HealthSuccess defines model for HealthSuccess.
type HealthSuccessJSONResponse ¶
type HealthSuccessJSONResponse struct { // Message ok Message string `json:"message"` }
type Healthz200JSONResponse ¶
type Healthz200JSONResponse struct{ HealthSuccessJSONResponse }
func (Healthz200JSONResponse) VisitHealthzResponse ¶
func (response Healthz200JSONResponse) VisitHealthzResponse(w http.ResponseWriter) error
type Healthz503JSONResponse ¶
type Healthz503JSONResponse struct{ ErrorResponseJSONResponse }
func (Healthz503JSONResponse) VisitHealthzResponse ¶
func (response Healthz503JSONResponse) VisitHealthzResponse(w http.ResponseWriter) error
type HealthzRequestObject ¶
type HealthzRequestObject struct { }
type HealthzResponseObject ¶
type HealthzResponseObject interface {
VisitHealthzResponse(w http.ResponseWriter) error
}
type OperationsAPI ¶
type OperationsAPI struct{}
type OwnerAccount200JSONResponse ¶
type OwnerAccount200JSONResponse struct{ AccountSuccessJSONResponse }
func (OwnerAccount200JSONResponse) VisitOwnerAccountResponse ¶
func (response OwnerAccount200JSONResponse) VisitOwnerAccountResponse(w http.ResponseWriter) error
type OwnerAccountParams ¶
type OwnerAccountParams struct {
Code *Code `form:"code,omitempty" json:"code,omitempty"`
}
OwnerAccountParams defines parameters for OwnerAccount.
type OwnerAccountRequestObject ¶
type OwnerAccountRequestObject struct { Id Id `json:"id"` Params OwnerAccountParams }
type OwnerAccountResponseObject ¶
type OwnerAccountResponseObject interface {
VisitOwnerAccountResponse(w http.ResponseWriter) error
}
type OwnerAccountdefaultJSONResponse ¶
func (OwnerAccountdefaultJSONResponse) VisitOwnerAccountResponse ¶
func (response OwnerAccountdefaultJSONResponse) VisitOwnerAccountResponse(w http.ResponseWriter) error
type OwnerAccounts200JSONResponse ¶
type OwnerAccounts200JSONResponse struct{ AccountsSuccessJSONResponse }
func (OwnerAccounts200JSONResponse) VisitOwnerAccountsResponse ¶
func (response OwnerAccounts200JSONResponse) VisitOwnerAccountsResponse(w http.ResponseWriter) error
type OwnerAccountsRequestObject ¶
type OwnerAccountsRequestObject struct { }
type OwnerAccountsResponseObject ¶
type OwnerAccountsResponseObject interface {
VisitOwnerAccountsResponse(w http.ResponseWriter) error
}
type OwnerAccountsdefaultJSONResponse ¶
func (OwnerAccountsdefaultJSONResponse) VisitOwnerAccountsResponse ¶
func (response OwnerAccountsdefaultJSONResponse) VisitOwnerAccountsResponse(w http.ResponseWriter) error
type OwnerTransactions200JSONResponse ¶
type OwnerTransactions200JSONResponse struct {
TransactionsSuccessJSONResponse
}
func (OwnerTransactions200JSONResponse) VisitOwnerTransactionsResponse ¶
func (response OwnerTransactions200JSONResponse) VisitOwnerTransactionsResponse(w http.ResponseWriter) error
type OwnerTransactionsRequestObject ¶
type OwnerTransactionsRequestObject struct {
Id Id `json:"id"`
}
type OwnerTransactionsResponseObject ¶
type OwnerTransactionsResponseObject interface {
VisitOwnerTransactionsResponse(w http.ResponseWriter) error
}
type OwnerTransactionsdefaultJSONResponse ¶
func (OwnerTransactionsdefaultJSONResponse) VisitOwnerTransactionsResponse ¶
func (response OwnerTransactionsdefaultJSONResponse) VisitOwnerTransactionsResponse(w http.ResponseWriter) error
type Readyz200JSONResponse ¶
type Readyz200JSONResponse struct{ HealthSuccessJSONResponse }
func (Readyz200JSONResponse) VisitReadyzResponse ¶
func (response Readyz200JSONResponse) VisitReadyzResponse(w http.ResponseWriter) error
type Readyz503JSONResponse ¶
type Readyz503JSONResponse struct{ ErrorResponseJSONResponse }
func (Readyz503JSONResponse) VisitReadyzResponse ¶
func (response Readyz503JSONResponse) VisitReadyzResponse(w http.ResponseWriter) error
type ReadyzRequestObject ¶
type ReadyzRequestObject struct { }
type ReadyzResponseObject ¶
type ReadyzResponseObject interface {
VisitReadyzResponse(w http.ResponseWriter) error
}
type Redeem200JSONResponse ¶
type Redeem200JSONResponse struct{ RedeemSuccessJSONResponse }
func (Redeem200JSONResponse) VisitRedeemResponse ¶
func (response Redeem200JSONResponse) VisitRedeemResponse(w http.ResponseWriter) error
type RedeemJSONRequestBody ¶
type RedeemJSONRequestBody = RedeemRequest
RedeemJSONRequestBody defines body for Redeem for application/json ContentType.
type RedeemRequest ¶
type RedeemRequest struct { // Amount The amount to issue, transfer or redeem. Amount Amount `json:"amount"` // Message optional message that will be visible to the auditor Message *string `json:"message,omitempty"` }
RedeemRequest Instructions to redeem tokens from an account
type RedeemRequestObject ¶
type RedeemRequestObject struct { Id Id `json:"id"` Body *RedeemJSONRequestBody }
type RedeemResponseObject ¶
type RedeemResponseObject interface {
VisitRedeemResponse(w http.ResponseWriter) error
}
type RedeemSuccess ¶
type RedeemSuccess struct { Message string `json:"message"` // Payload Transaction id Payload string `json:"payload"` }
RedeemSuccess defines model for RedeemSuccess.
type RedeemdefaultJSONResponse ¶
func (RedeemdefaultJSONResponse) VisitRedeemResponse ¶
func (response RedeemdefaultJSONResponse) VisitRedeemResponse(w http.ResponseWriter) error
type ServerInterface ¶
type ServerInterface interface { // (GET /healthz) Healthz(ctx echo.Context) error // Get all accounts on this node and their balances // (GET /owner/accounts) OwnerAccounts(ctx echo.Context) error // Get an account and their balances // (GET /owner/accounts/{id}) OwnerAccount(ctx echo.Context, id Id, params OwnerAccountParams) error // Redeem (burn) tokens // (POST /owner/accounts/{id}/redeem) Redeem(ctx echo.Context, id Id) error // Get all transactions for an account // (GET /owner/accounts/{id}/transactions) OwnerTransactions(ctx echo.Context, id Id) error // Transfer tokens to another account // (POST /owner/accounts/{id}/transfer) Transfer(ctx echo.Context, id Id) error // (GET /readyz) Readyz(ctx echo.Context) error }
ServerInterface represents all server handlers.
func NewStrictHandler ¶
func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) Healthz ¶
func (w *ServerInterfaceWrapper) Healthz(ctx echo.Context) error
Healthz converts echo context to params.
func (*ServerInterfaceWrapper) OwnerAccount ¶
func (w *ServerInterfaceWrapper) OwnerAccount(ctx echo.Context) error
OwnerAccount converts echo context to params.
func (*ServerInterfaceWrapper) OwnerAccounts ¶
func (w *ServerInterfaceWrapper) OwnerAccounts(ctx echo.Context) error
OwnerAccounts converts echo context to params.
func (*ServerInterfaceWrapper) OwnerTransactions ¶
func (w *ServerInterfaceWrapper) OwnerTransactions(ctx echo.Context) error
OwnerTransactions converts echo context to params.
func (*ServerInterfaceWrapper) Readyz ¶
func (w *ServerInterfaceWrapper) Readyz(ctx echo.Context) error
Readyz converts echo context to params.
func (*ServerInterfaceWrapper) Redeem ¶
func (w *ServerInterfaceWrapper) Redeem(ctx echo.Context) error
Redeem converts echo context to params.
func (*ServerInterfaceWrapper) Transfer ¶
func (w *ServerInterfaceWrapper) Transfer(ctx echo.Context) error
Transfer converts echo context to params.
type StrictHandlerFunc ¶
type StrictHandlerFunc = runtime.StrictEchoHandlerFunc
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc = runtime.StrictEchoMiddlewareFunc
type StrictServerInterface ¶
type StrictServerInterface interface { // (GET /healthz) Healthz(ctx context.Context, request HealthzRequestObject) (HealthzResponseObject, error) // Get all accounts on this node and their balances // (GET /owner/accounts) OwnerAccounts(ctx context.Context, request OwnerAccountsRequestObject) (OwnerAccountsResponseObject, error) // Get an account and their balances // (GET /owner/accounts/{id}) OwnerAccount(ctx context.Context, request OwnerAccountRequestObject) (OwnerAccountResponseObject, error) // Redeem (burn) tokens // (POST /owner/accounts/{id}/redeem) Redeem(ctx context.Context, request RedeemRequestObject) (RedeemResponseObject, error) // Get all transactions for an account // (GET /owner/accounts/{id}/transactions) OwnerTransactions(ctx context.Context, request OwnerTransactionsRequestObject) (OwnerTransactionsResponseObject, error) // Transfer tokens to another account // (POST /owner/accounts/{id}/transfer) Transfer(ctx context.Context, request TransferRequestObject) (TransferResponseObject, error) // (GET /readyz) Readyz(ctx context.Context, request ReadyzRequestObject) (ReadyzResponseObject, error) }
StrictServerInterface represents all server handlers.
type TransactionRecord ¶
type TransactionRecord struct { // Amount The amount to issue, transfer or redeem. Amount Amount `json:"amount"` // Id transaction id Id string `json:"id"` // Message user provided message Message string `json:"message"` // Recipient the recipient of the transaction Recipient string `json:"recipient"` // Sender the sender of the transaction Sender string `json:"sender"` // Status Unknown | Pending | Confirmed | Deleted Status string `json:"status"` // Timestamp timestamp in the format: "2018-03-20T09:12:28Z" Timestamp time.Time `json:"timestamp"` }
TransactionRecord A transaction
type TransactionsSuccess ¶
type TransactionsSuccess struct { Message string `json:"message"` Payload []TransactionRecord `json:"payload"` }
TransactionsSuccess defines model for TransactionsSuccess.
type TransactionsSuccessJSONResponse ¶
type TransactionsSuccessJSONResponse struct { Message string `json:"message"` Payload []TransactionRecord `json:"payload"` }
type Transfer200JSONResponse ¶
type Transfer200JSONResponse struct{ TransferSuccessJSONResponse }
func (Transfer200JSONResponse) VisitTransferResponse ¶
func (response Transfer200JSONResponse) VisitTransferResponse(w http.ResponseWriter) error
type TransferJSONRequestBody ¶
type TransferJSONRequestBody = TransferRequest
TransferJSONRequestBody defines body for Transfer for application/json ContentType.
type TransferRequest ¶
type TransferRequest struct { // Amount The amount to issue, transfer or redeem. Amount Amount `json:"amount"` // Counterparty The counterparty in a Transfer or Issuance transaction. Counterparty Counterparty `json:"counterparty"` // Message optional message that will be sent and stored with the transfer transaction Message *string `json:"message,omitempty"` }
TransferRequest Instructions to issue or transfer tokens to an account
type TransferRequestObject ¶
type TransferRequestObject struct { Id Id `json:"id"` Body *TransferJSONRequestBody }
type TransferResponseObject ¶
type TransferResponseObject interface {
VisitTransferResponse(w http.ResponseWriter) error
}
type TransferSuccess ¶
type TransferSuccess struct { Message string `json:"message"` // Payload Transaction id Payload string `json:"payload"` }
TransferSuccess defines model for TransferSuccess.
type TransferdefaultJSONResponse ¶
func (TransferdefaultJSONResponse) VisitTransferResponse ¶
func (response TransferdefaultJSONResponse) VisitTransferResponse(w http.ResponseWriter) error