monredt

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

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) Cleanup

func (m *Middleware) Cleanup() error

Cleanup cleans up the handler.

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.

Jump to

Keyboard shortcuts

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