Documentation ¶
Index ¶
- Constants
- func CheckHeightAndProve(w http.ResponseWriter, height, prove string, codespace sdk.CodespaceType) (isValid bool)
- func GetNecessaryParams(cliCtx context.Context, request *http.Request, cdc *codec.Codec, ...) (key string, from sdk.AccAddress, nonce, gas uint64, err error)
- func MiddleHandler(ctx context.Context, ...) http.HandlerFunc
- func ParseHTTPArgsWithLimit(r *http.Request, defaultLimit int) (tags []string, page, limit int, err error)
- func ParseQueryHeightOrReturnBadRequest(w http.ResponseWriter, cliCtx context.Context, r *http.Request, ...) (context.Context, bool, error)
- func PostProcessResponseBare(w http.ResponseWriter, ctx context.Context, body interface{})
- func WriteErrorRes(w http.ResponseWriter, err string)
- type QueryRes
- type Response
Constants ¶
View Source
const ( DefaultPage = 1 DefaultLimit = 30 // should be consistent with tendermint/tendermint/rpc/collactor/pipe.go:19 DefaultSimulateGas = 200000 )
Variables ¶
This section is empty.
Functions ¶
func CheckHeightAndProve ¶
func CheckHeightAndProve(w http.ResponseWriter, height, prove string, codespace sdk.CodespaceType) (isValid bool)
func GetNecessaryParams ¶
func MiddleHandler ¶
func MiddleHandler(ctx context.Context, f func(clictx context.Context, w http.ResponseWriter, r *http.Request), codeSpace sdk.CodespaceType) http.HandlerFunc
func ParseHTTPArgsWithLimit ¶
func ParseHTTPArgsWithLimit(r *http.Request, defaultLimit int) (tags []string, page, limit int, err error)
ParseHTTPArgsWithLimit parses the request's URL and returns a slice containing all arguments pairs. It separates page and limit used for pagination where a default limit can be provided.
func PostProcessResponseBare ¶
func PostProcessResponseBare(w http.ResponseWriter, ctx context.Context, body interface{})
func WriteErrorRes ¶
func WriteErrorRes(w http.ResponseWriter, err string)
Types ¶
type QueryRes ¶
type Response ¶
type Response struct { Ret int64 `json:"ret"` Data json.RawMessage `json:"data"` Message string `json:"message"` }
func NewErrorRes ¶
Click to show internal directories.
Click to hide internal directories.