Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var GenesisJSONText string
GenesisJSONText is initialized when the node starts.
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 a human-readable error.
Types ¶
type HandlerFunc ¶
type HandlerFunc func(ReqContext, echo.Context)
HandlerFunc defines a wrapper for http.HandlerFunc that includes a context
type NodeInterface ¶
type NodeInterface interface { GenesisHash() crypto.Digest GenesisID() string Status() (s node.StatusReport, err error) }
NodeInterface defines the node's methods required by the common APIs
type ReqContext ¶
type ReqContext struct { Node NodeInterface Log logging.Logger Context echo.Context Shutdown <-chan struct{} }
ReqContext is passed to each of the handlers below via wrapCtx, allowing handlers to interact with the node
Click to show internal directories.
Click to hide internal directories.