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 Amount
- type Controller
- func (c Controller) Healthz(ctx context.Context, request HealthzRequestObject) (HealthzResponseObject, error)
- func (c Controller) Issue(ctx context.Context, request IssueRequestObject) (IssueResponseObject, error)
- func (c Controller) Readyz(ctx context.Context, request ReadyzRequestObject) (ReadyzResponseObject, error)
- type Counterparty
- type EchoRouter
- type Error
- type ErrorResponse
- type ErrorResponseJSONResponse
- type HealthSuccess
- type HealthSuccessJSONResponse
- type Healthz200JSONResponse
- type Healthz503JSONResponse
- type HealthzRequestObject
- type HealthzResponseObject
- type Issue200JSONResponse
- type IssueJSONRequestBody
- type IssueRequestObject
- type IssueResponseObject
- type IssueSuccess
- type IssueSuccessJSONResponse
- type IssuedefaultJSONResponse
- type Logger
- type Readyz200JSONResponse
- type Readyz503JSONResponse
- type ReadyzRequestObject
- type ReadyzResponseObject
- type ServerInterface
- type ServerInterfaceWrapper
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type TransferRequest
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 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) Issue ¶
func (c Controller) Issue(ctx context.Context, request IssueRequestObject) (IssueResponseObject, error)
Issue tokens to an account (POST /issue)
func (Controller) Readyz ¶
func (c Controller) Readyz(ctx context.Context, request ReadyzRequestObject) (ReadyzResponseObject, error)
(GET /readyz)
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 Issue200JSONResponse ¶
type Issue200JSONResponse struct{ IssueSuccessJSONResponse }
func (Issue200JSONResponse) VisitIssueResponse ¶
func (response Issue200JSONResponse) VisitIssueResponse(w http.ResponseWriter) error
type IssueJSONRequestBody ¶
type IssueJSONRequestBody = TransferRequest
IssueJSONRequestBody defines body for Issue for application/json ContentType.
type IssueRequestObject ¶
type IssueRequestObject struct {
Body *IssueJSONRequestBody
}
type IssueResponseObject ¶
type IssueResponseObject interface {
VisitIssueResponse(w http.ResponseWriter) error
}
type IssueSuccess ¶
type IssueSuccess struct { Message string `json:"message"` // Payload Transaction id Payload string `json:"payload"` }
IssueSuccess defines model for IssueSuccess.
type IssuedefaultJSONResponse ¶
func (IssuedefaultJSONResponse) VisitIssueResponse ¶
func (response IssuedefaultJSONResponse) VisitIssueResponse(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 ServerInterface ¶
type ServerInterface interface { // (GET /healthz) Healthz(ctx echo.Context) error // Issue tokens to an account // (POST /issuer/issue) Issue(ctx echo.Context) 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) Issue ¶
func (w *ServerInterfaceWrapper) Issue(ctx echo.Context) error
Issue converts echo context to params.
func (*ServerInterfaceWrapper) Readyz ¶
func (w *ServerInterfaceWrapper) Readyz(ctx echo.Context) error
Readyz 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) // Issue tokens to an account // (POST /issuer/issue) Issue(ctx context.Context, request IssueRequestObject) (IssueResponseObject, error) // (GET /readyz) Readyz(ctx context.Context, request ReadyzRequestObject) (ReadyzResponseObject, error) }
StrictServerInterface represents all server handlers.
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