Documentation ¶
Index ¶
- Constants
- Variables
- func GetAcceptHeaderContentType(c echo.Context, supportedContentTypes ...string) (string, error)
- func GetRequestContentType(c echo.Context, supportedContentTypes ...string) (string, error)
- func GetURL(protocol string, host string, port uint16, path ...string) string
- func JSONResponse(c echo.Context, statusCode int, result interface{}) error
- func NewEcho(logger *logger.Logger, onHTTPError func(err error, c echo.Context), ...) *echo.Echo
- func ParseAliasIDParam(c echo.Context, paramName string) (*iotago.AliasID, error)
- func ParseBech32AddressQueryParam(c echo.Context, prefix iotago.NetworkPrefix, paramName string) (iotago.Address, error)
- func ParseBlockIDParam(c echo.Context, paramName string) (iotago.BlockID, error)
- func ParseBoolQueryParam(c echo.Context, paramName string) (bool, error)
- func ParseFoundryIDParam(c echo.Context, paramName string) (*iotago.FoundryID, error)
- func ParseHexQueryParam(c echo.Context, paramName string, maxLen int) ([]byte, error)
- func ParseMilestoneIDParam(c echo.Context, paramName string) (*iotago.MilestoneID, error)
- func ParseMilestoneIndexParam(c echo.Context, paramName string) (iotago.MilestoneIndex, error)
- func ParseNFTIDParam(c echo.Context, paramName string) (*iotago.NFTID, error)
- func ParseOutputIDParam(c echo.Context, paramName string) (iotago.OutputID, error)
- func ParseTransactionIDParam(c echo.Context, paramName string) (iotago.TransactionID, error)
- func ParseUint32QueryParam(c echo.Context, paramName string, maxValue ...uint32) (uint32, error)
- func ParseUnixTimestampQueryParam(c echo.Context, paramName string) (time.Time, error)
- type HTTPErrorResponse
- type HTTPErrorResponseEnvelope
Constants ¶
View Source
const ( MIMEApplicationVendorIOTASerializerV1 = "application/vnd.iota.serializer-v1" ProtocolHTTP = "http" ProtocolHTTPS = "https" ProtocolWS = "ws" ProtocolWSS = "wss" )
Variables ¶
View Source
var ( // ErrInvalidParameter defines the invalid parameter error. ErrInvalidParameter = echo.NewHTTPError(http.StatusBadRequest, "invalid parameter") // ErrNotAcceptable defines the not acceptable error. ErrNotAcceptable = echo.NewHTTPError(http.StatusNotAcceptable) )
Functions ¶
func GetRequestContentType ¶
func JSONResponse ¶
JSONResponse sends the JSON response with status code.
func NewEcho ¶
func NewEcho(logger *logger.Logger, onHTTPError func(err error, c echo.Context), debugRequestLoggerEnabled bool) *echo.Echo
NewEcho returns a new Echo instance. It hides the banner, adds a default HTTPErrorHandler and the Recover middleware.
func ParseAliasIDParam ¶
func ParseBlockIDParam ¶
func ParseBoolQueryParam ¶
func ParseFoundryIDParam ¶
func ParseHexQueryParam ¶
func ParseMilestoneIDParam ¶
func ParseMilestoneIDParam(c echo.Context, paramName string) (*iotago.MilestoneID, error)
func ParseMilestoneIndexParam ¶
func ParseMilestoneIndexParam(c echo.Context, paramName string) (iotago.MilestoneIndex, error)
func ParseNFTIDParam ¶
func ParseOutputIDParam ¶
func ParseTransactionIDParam ¶
func ParseTransactionIDParam(c echo.Context, paramName string) (iotago.TransactionID, error)
func ParseUint32QueryParam ¶
Types ¶
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.
Click to show internal directories.
Click to hide internal directories.