api

package
v0.0.0-...-f71cfea Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JSONRPCErrorCodes = map[int]string{
	-32600: `Invalid Request`,
	-32700: `Parse error`,
}

JSONRPCErrorCodes holds code to message map

Functions

func GetIP

func GetIP(ctx *fasthttp.RequestCtx) string

GetIP return remote ip address as string

func JSON

func JSON(ctx *fasthttp.RequestCtx)

JSON creates response with JSON formatted string

func JSONP

func JSONP(ctx *fasthttp.RequestCtx)

JSONP creates response as JSONP string

func JSONRPC

func JSONRPC(ctx *fasthttp.RequestCtx)

func Plain

func Plain(ctx *fasthttp.RequestCtx)

Plain creates simple text response

Types

type JSONRPCResponse

type JSONRPCResponse struct {
	ID   *string
	Code int
}

JSONRPCResponse holds basic response

func JSONRPCDecode

func JSONRPCDecode(v interface{}) *JSONRPCResponse

JSONRPCDecode decoding JSONRPC request from interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL