responses

package
v0.11.9 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSON

func JSON(w http.ResponseWriter, v interface{})

JSON is a shorthand for serializing provided structure and writing it into the provided HTTP writer as JSON.

func JSONRPCError

func JSONRPCError(w http.ResponseWriter, message string, code int)

JSONRPCError is a shorthand for creating an RPCResponse instance with specified error message and code.

func NewJSONRPCError

func NewJSONRPCError(message string, code int) *jsonrpc.RPCResponse

func PrepareJSONWriter

func PrepareJSONWriter(w http.ResponseWriter)

PrepareJSONWriter prepares HTTP response writer for JSON content-type.

Types

This section is empty.

Jump to

Keyboard shortcuts

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