{"modulePath":"github.com/iotaledger/inx-app","version":"v1.0.0-rc.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package httpserver\n\n## Constants\n\n```go\nconst (\n\tMIMEApplicationVendorIOTASerializerV1 = \"application/vnd.iota.serializer-v1\"\n\tProtocolHTTP                          = \"http\"\n\tProtocolHTTPS                         = \"https\"\n\tProtocolWS                            = \"ws\"\n\tProtocolWSS                           = \"wss\"\n)\n```\n\n## Variables\n\n```go\nvar (\n\t// ErrInvalidParameter defines the invalid parameter error.\n\tErrInvalidParameter = echo.NewHTTPError(http.StatusBadRequest, \"invalid parameter\")\n\n\t// ErrNotAcceptable defines the not acceptable error.\n\tErrNotAcceptable = echo.NewHTTPError(http.StatusNotAcceptable)\n)\n```\n\n## Functions\n\n```go\nfunc GetAcceptHeaderContentType(c echo.Context, supportedContentTypes ...string) (string, error)\n```\n\n```go\nfunc GetRequestContentType(c echo.Context, supportedContentTypes ...string) (string, error)\n```\n\n```go\nfunc GetURL(protocol string, host string, port uint16, path ...string) string\n```\n\n```go\nfunc JSONResponse(c echo.Context, statusCode int, result interface{}) error\n```\nJSONResponse sends the JSON response with status code.\n\n```go\nfunc NewEcho(logger *logger.Logger, onHTTPError func(err error, c echo.Context), debugRequestLoggerEnabled bool) *echo.Echo\n```\nNewEcho returns a new Echo instance. It hides the banner, adds a default HTTPErrorHandler and the Recover middleware.\n\n```go\nfunc ParseAliasIDParam(c echo.Context, paramName string) (*iotago.AliasID, error)\n```\n\n```go\nfunc ParseBech32AddressQueryParam(c echo.Context, prefix iotago.NetworkPrefix, paramName string) (iotago.Address, error)\n```\n\n```go\nfunc ParseBlockIDParam(c echo.Context, paramName string) (iotago.BlockID, error)\n```\n\n```go\nfunc ParseBoolQueryParam(c echo.Context, paramName string) (bool, error)\n```\n\n```go\nfunc ParseFoundryIDParam(c echo.Context, paramName string) (*iotago.FoundryID, error)\n```\n\n```go\nfunc ParseHexQueryParam(c echo.Context, paramName string, maxLen int) ([]byte, error)\n```\n\n```go\nfunc ParseMilestoneIDParam(c echo.Context, paramName string) (*iotago.MilestoneID, error)\n```\n\n```go\nfunc ParseMilestoneIndexParam(c echo.Context, paramName string) (iotago.MilestoneIndex, error)\n```\n\n```go\nfunc ParseNFTIDParam(c echo.Context, paramName string) (*iotago.NFTID, error)\n```\n\n```go\nfunc ParseOutputIDParam(c echo.Context, paramName string) (iotago.OutputID, error)\n```\n\n```go\nfunc ParseTransactionIDParam(c echo.Context, paramName string) (iotago.TransactionID, error)\n```\n\n```go\nfunc ParseUint32QueryParam(c echo.Context, paramName string, maxValue ...uint32) (uint32, error)\n```\n\n```go\nfunc ParseUnixTimestampQueryParam(c echo.Context, paramName string) (time.Time, error)\n```\n\n## Types\n\n```go\ntype HTTPErrorResponse struct {\n\tCode    string `json:\"code\"`\n\tMessage string `json:\"message\"`\n}\n```\nHTTPErrorResponse defines the error struct for the HTTPErrorResponseEnvelope.\n\n```go\ntype HTTPErrorResponseEnvelope struct {\n\tError HTTPErrorResponse `json:\"error\"`\n}\n```\nHTTPErrorResponseEnvelope defines the error response schema for node API responses.\n\n","path":"github.com/iotaledger/inx-app/pkg/httpserver","name":"httpserver","synopsis":"","isRedistributable":true}
