lib

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2019 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SwaggerSpecJSON string

SwaggerSpecJSON is autogenerated from swagger.json, and bundled in with a script on build.

Functions

func ErrorResponse

func ErrorResponse(w http.ResponseWriter, status int, internalErr error, publicErr string, logger logging.Logger)

ErrorResponse sets the specified status code (should != 200), and fills in the a human readable error.

Types

type HandlerFunc

type HandlerFunc func(ReqContext, http.ResponseWriter, *http.Request)

HandlerFunc defines a wrapper for http.HandlerFunc that includes a context

type ReqContext

type ReqContext struct {
	Node *node.AlgorandFullNode
	Log  logging.Logger
}

ReqContext is passed to each of the handlers below via wrapCtx, allowing handlers to interact with the node

type Route

type Route struct {
	Name        string
	Method      string
	Path        string
	HandlerFunc HandlerFunc
}

Route type description

type Routes

type Routes []Route

Routes contains all routes

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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