Documentation ¶
Index ¶
- Variables
- type AvailabilityResponse
- type Config
- type Handler
- type NamespacedDataResponse
- type NamespacedSharesResponse
- type Server
- func (s *Server) ListenAddr() string
- func (s *Server) RegisterHandlerFunc(pattern string, handlerFunc http.HandlerFunc, method string)
- func (s *Server) RegisterMiddleware(m mux.MiddlewareFunc)
- func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *Server) Start(context.Context) error
- func (s *Server) Stop(context.Context) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidAddressFormat = errors.New("address must be a valid account or validator address") ErrMissingAddress = errors.New("address not specified") )
Functions ¶
This section is empty.
Types ¶
type AvailabilityResponse ¶
type AvailabilityResponse struct { Available bool `json:"available"` Probability string `json:"probability_of_availability"` }
AvailabilityResponse represents the response to a `/data_available` request.
type Config ¶
func DefaultConfig ¶
func DefaultConfig() Config
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*Handler) RegisterEndpoints ¶
func (*Handler) RegisterMiddleware ¶
type NamespacedDataResponse ¶
NamespacedDataResponse represents the response to a DataByNamespace request.
type NamespacedSharesResponse ¶
type NamespacedSharesResponse struct {}
NamespacedSharesResponse represents the response to a SharesByNamespace request.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents an RPC server on the Node. TODO @renaynay: eventually, gateway server should be able to be toggled on and off.
func (*Server) ListenAddr ¶
ListenAddr returns the listen address of the server.
func (*Server) RegisterHandlerFunc ¶
func (s *Server) RegisterHandlerFunc(pattern string, handlerFunc http.HandlerFunc, method string)
RegisterHandlerFunc registers the given http.HandlerFunc on the Server's multiplexer on the given pattern.
func (*Server) RegisterMiddleware ¶
func (s *Server) RegisterMiddleware(m mux.MiddlewareFunc)
RegisterMiddleware allows to register a custom middleware that will be called before http.Request will reach handler.
func (*Server) ServeHTTP ¶
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP serves inbound requests on the Server.