lib

package
v0.0.0-...-d1fbc97 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

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

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