Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPConfig ¶ added in v1.9.12
type PathAdder ¶
type PathAdder interface { // AddRoute registers a route to a handler. AddRoute(handler http.Handler, base, endpoint string) error // AddAliases registers aliases to the server AddAliases(endpoint string, aliases ...string) error }
func PathWriterFromWithReadLock ¶
func PathWriterFromWithReadLock(pather PathAdderWithReadLock) PathAdder
type PathAdderWithReadLock ¶
type PathAdderWithReadLock interface { // AddRouteWithReadLock registers a route to a handler assuming the http // read lock is currently held. AddRouteWithReadLock(handler http.Handler, base, endpoint string) error // AddAliasesWithReadLock registers aliases to the server assuming the http read // lock is currently held. AddAliasesWithReadLock(endpoint string, aliases ...string) error }
type Server ¶
type Server interface { PathAdder PathAdderWithReadLock // Dispatch starts the API server Dispatch() error // RegisterChain registers the API endpoints associated with this chain. // That is, add <route, handler> pairs to server so that API calls can be // made to the VM. RegisterChain(chainName string, ctx *snow.ConsensusContext, vm common.VM) // Shutdown this server Shutdown() error }
Server maintains the HTTP router
func New ¶
func New( log logging.Logger, factory logging.Factory, listener net.Listener, allowedOrigins []string, shutdownTimeout time.Duration, nodeID ids.NodeID, tracingEnabled bool, tracer trace.Tracer, registerer prometheus.Registerer, httpConfig HTTPConfig, allowedHosts []string, ) (Server, error)
New returns an instance of a Server.
Directories ¶
Path | Synopsis |
---|---|
Package servermock is a generated GoMock package.
|
Package servermock is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.