Documentation ¶
Index ¶
- Constants
- Variables
- func JSONResponse(c echo.Context, statusCode int, result interface{}) error
- func ParseBech32AddressParam(c echo.Context, prefix iotago.NetworkPrefix) (iotago.Address, error)
- func ParseEd25519AddressParam(c echo.Context) (*iotago.Ed25519Address, error)
- func ParseMessageIDParam(c echo.Context) (hornet.MessageID, error)
- func ParseMilestoneIndexParam(c echo.Context) (milestone.Index, error)
- func ParseOutputIDParam(c echo.Context) (*iotago.UTXOInputID, error)
- func ParsePeerIDParam(c echo.Context) (peer.ID, error)
- func ParseTransactionIDParam(c echo.Context) (*iotago.TransactionID, error)
- type AllowedRoute
- type HTTPErrorResponse
- type HTTPErrorResponseEnvelope
- type HTTPOkResponseEnvelope
Constants ¶
View Source
const ( // ParameterMessageID is used to identify a message by its ID. ParameterMessageID = "messageID" // ParameterTransactionID is used to identify a transaction by its ID. ParameterTransactionID = "transactionID" // ParameterOutputID is used to identify an output by its ID. ParameterOutputID = "outputID" // ParameterAddress is used to identify an address. ParameterAddress = "address" // ParameterMilestoneIndex is used to identify a milestone. ParameterMilestoneIndex = "milestoneIndex" // ParameterPeerID is used to identify a peer. ParameterPeerID = "peerID" )
Variables ¶
View Source
var ( // ErrInvalidParameter defines the invalid parameter error. ErrInvalidParameter = echo.NewHTTPError(http.StatusBadRequest, "invalid parameter") // ErrServiceNotImplemented defines the service not implemented error. ErrServiceNotImplemented = echo.NewHTTPError(http.StatusNotImplemented, "service not implemented") )
Functions ¶
func JSONResponse ¶
JSONResponse wraps the result into a "data" field and sends the JSON response with status code.
func ParseBech32AddressParam ¶ added in v1.1.0
func ParseBech32AddressParam(c echo.Context, prefix iotago.NetworkPrefix) (iotago.Address, error)
func ParseEd25519AddressParam ¶ added in v1.1.0
func ParseEd25519AddressParam(c echo.Context) (*iotago.Ed25519Address, error)
func ParseMessageIDParam ¶ added in v1.1.0
func ParseMilestoneIndexParam ¶ added in v1.1.0
func ParseOutputIDParam ¶ added in v1.1.0
func ParseOutputIDParam(c echo.Context) (*iotago.UTXOInputID, error)
func ParsePeerIDParam ¶ added in v1.1.0
func ParseTransactionIDParam ¶ added in v1.1.0
func ParseTransactionIDParam(c echo.Context) (*iotago.TransactionID, error)
Types ¶
type AllowedRoute ¶
type AllowedRoute func(echo.Context) bool
AllowedRoute defines a function to allow or disallow routes.
type HTTPErrorResponse ¶
HTTPErrorResponse defines the error struct for the HTTPErrorResponseEnvelope.
type HTTPErrorResponseEnvelope ¶
type HTTPErrorResponseEnvelope struct {
Error HTTPErrorResponse `json:"error"`
}
HTTPErrorResponseEnvelope defines the error response schema for node API responses.
type HTTPOkResponseEnvelope ¶
type HTTPOkResponseEnvelope struct {
// The response is encapsulated in the Data field.
Data interface{} `json:"data"`
}
HTTPOkResponseEnvelope defines the ok response schema for node API responses.
Click to show internal directories.
Click to hide internal directories.