restapi

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// the bind address on which the REST API listens on
	CfgRestAPIBindAddress = "restAPI.bindAddress"
	// the HTTP REST routes which can be called without authorization. Wildcards using * are allowed
	CfgRestAPIPublicRoutes = "restAPI.publicRoutes"
	// the HTTP REST routes which need to be called with authorization. Wildcards using * are allowed
	CfgRestAPIProtectedRoutes = "restAPI.protectedRoutes"
	// salt used inside the JWT tokens for the REST API. Change this to a different value to invalidate JWT tokens not matching this new value
	CfgRestAPIJWTAuthSalt = "restAPI.jwtAuth.salt"
	// whether the node does PoW if messages are received via API
	CfgRestAPIPoWEnabled = "restAPI.powEnabled"
	// the amount of workers used for calculating PoW when issuing messages via API
	CfgRestAPIPoWWorkerCount = "restAPI.powWorkerCount"
	// the maximum number of characters that the body of an API call may contain
	CfgRestAPILimitsMaxBodyLength = "restAPI.limits.bodyLength"
	// the maximum number of results that may be returned by an endpoint
	CfgRestAPILimitsMaxResults = "restAPI.limits.maxResults"
)

Variables

View Source
var (
	Plugin *node.Plugin
)

Functions

This section is empty.

Types

type RestRouteManager

type RestRouteManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*RestRouteManager) AddProxyRoute

func (p *RestRouteManager) AddProxyRoute(route string, host string, port uint32) error

AddProxyRoute adds a proxy route to the Routes endpoint and configures a remote proxy for this route.

func (*RestRouteManager) AddRoute

func (p *RestRouteManager) AddRoute(route string) *echo.Group

AddRoute adds a route to the Routes endpoint and returns group to be used to register endpoints.

func (*RestRouteManager) RemoveRoute

func (p *RestRouteManager) RemoveRoute(route string)

RemoveRoute removes a route from the Routes endpoint.

func (*RestRouteManager) Routes

func (p *RestRouteManager) Routes() []string

type RoutesResponse

type RoutesResponse struct {
	Routes []string `json:"routes"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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