Documentation
¶
Index ¶
- type Middleware
- func (Middleware) CaddyModule() caddy.ModuleInfo
- func (m *Middleware) Cleanup() error
- func (m *Middleware) Provision(ctx caddy.Context) (err error)
- func (m Middleware) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
- func (m *Middleware) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
- func (m *Middleware) Validate() error
- func (m Middleware) WShandler(w http.ResponseWriter, r *http.Request) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Middleware ¶
type Middleware struct { // The location of the Geth node NodeURL string `json:"nodeurl,omitempty"` // contains filtered or unexported fields }
Middleware implements an HTTP handler that serves the WebSocket so the client is notified for each block in RedT.
func (Middleware) CaddyModule ¶
func (Middleware) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (*Middleware) Provision ¶
func (m *Middleware) Provision(ctx caddy.Context) (err error)
Provision implements caddy.Provisioner.
func (Middleware) ServeHTTP ¶
func (m Middleware) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
ServeHTTP implements caddyhttp.MiddlewareHandler.
func (*Middleware) UnmarshalCaddyfile ¶
func (m *Middleware) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
UnmarshalCaddyfile implements caddyfile.Unmarshaler.
func (*Middleware) Validate ¶
func (m *Middleware) Validate() error
Validate implements caddy.Validator.
func (Middleware) WShandler ¶
func (m Middleware) WShandler(w http.ResponseWriter, r *http.Request) error
WShandler is the WebSockets HTTP handler that upgrades the connection to websocket and starts looping receiving headers from the blockchain node and sending to the client the updated statistics.
Click to show internal directories.
Click to hide internal directories.