Documentation ¶
Index ¶
- type HttpContext
- type HttpHandler
- func (h *HttpHandler) AddNamespace(namespace string) error
- func (h *HttpHandler) AddPeer(peer string) error
- func (h *HttpHandler) AddProxyHandler(path string)
- func (h *HttpHandler) Address() string
- func (h *HttpHandler) ConnectionType() string
- func (h *HttpHandler) Init(c *transports.Connection) error
- func (h *HttpHandler) Listen(receiver chan<- transports.Message)
- func (h *HttpHandler) Send(msg transports.Message) error
- func (h *HttpHandler) SendUnicast(address string, msg transports.Message) error
- func (h *HttpHandler) SetBootnodes(bootnodes []string)
- func (h *HttpHandler) SetProxy(p *Proxy)
- func (h *HttpHandler) String() string
- type HttpWsHandler
- func (h *HttpWsHandler) AddNamespace(namespace string) error
- func (h *HttpWsHandler) AddPeer(peer string) error
- func (h *HttpWsHandler) AddProxyHandler(path string)
- func (h *HttpWsHandler) Address() string
- func (h *HttpWsHandler) ConnectionType() string
- func (h *HttpWsHandler) Init(c *transports.Connection) error
- func (h *HttpWsHandler) Listen(receiver chan<- transports.Message)
- func (h *HttpWsHandler) Send(msg transports.Message) error
- func (h *HttpWsHandler) SendUnicast(address string, msg transports.Message) error
- func (h *HttpWsHandler) SetBootnodes(bootnodes []string)
- func (h *HttpWsHandler) SetProxy(p *Proxy)
- func (h *HttpWsHandler) String() string
- type Proxy
- func (p *Proxy) AddEndpoint(url string) func(writer http.ResponseWriter, reader *http.Request)
- func (p *Proxy) AddHandler(path string, handler http.HandlerFunc)
- func (p *Proxy) AddMixedHandler(path string, HTTPhandler http.HandlerFunc, WShandler ProxyWsHandler, ...)
- func (p *Proxy) AddWsHTTPBridge(url string) ProxyWsHandler
- func (p *Proxy) AddWsHandler(path string, handler ProxyWsHandler, readLimit int64)
- func (p *Proxy) AddWsWsBridge(url string, readLimit int64) ProxyWsHandler
- func (p *Proxy) GenerateSSLCertificate(tlsConfig *tls.Config) (*http.Server, *autocert.Manager)
- func (p *Proxy) Init() error
- func (p *Proxy) ProxyIPC(path string) http.HandlerFunc
- type ProxyWsHandler
- type WebsocketContext
- type WebsocketHandle
- func (w *WebsocketHandle) AddNamespace(namespace string) error
- func (w *WebsocketHandle) AddPeer(peer string) error
- func (w *WebsocketHandle) AddProxyHandler(path string)
- func (w *WebsocketHandle) Address() string
- func (w *WebsocketHandle) ConnectionType() string
- func (w *WebsocketHandle) Init(c *transports.Connection) error
- func (w *WebsocketHandle) Listen(receiver chan<- transports.Message)
- func (w *WebsocketHandle) Send(msg transports.Message) error
- func (w *WebsocketHandle) SendUnicast(address string, msg transports.Message) error
- func (w *WebsocketHandle) SetBootnodes(bootnodes []string)
- func (w *WebsocketHandle) SetProxy(p *Proxy)
- func (w *WebsocketHandle) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpContext ¶
type HttpContext struct { Writer http.ResponseWriter Request *http.Request // contains filtered or unexported fields }
func (*HttpContext) ConnectionType ¶
func (h *HttpContext) ConnectionType() string
func (*HttpContext) Send ¶
func (h *HttpContext) Send(msg transports.Message) error
type HttpHandler ¶
type HttpHandler struct { Proxy *Proxy // proxy where the ws will be associated // contains filtered or unexported fields }
func (*HttpHandler) AddNamespace ¶
func (h *HttpHandler) AddNamespace(namespace string) error
AddNamespace adds a new namespace to the transport
func (*HttpHandler) AddPeer ¶
func (h *HttpHandler) AddPeer(peer string) error
func (*HttpHandler) AddProxyHandler ¶
func (h *HttpHandler) AddProxyHandler(path string)
AddProxyHandler adds the current websocket handler into the Proxy
func (*HttpHandler) Address ¶
func (h *HttpHandler) Address() string
func (*HttpHandler) ConnectionType ¶
func (h *HttpHandler) ConnectionType() string
func (*HttpHandler) Init ¶
func (h *HttpHandler) Init(c *transports.Connection) error
func (*HttpHandler) Listen ¶
func (h *HttpHandler) Listen(receiver chan<- transports.Message)
func (*HttpHandler) Send ¶
func (h *HttpHandler) Send(msg transports.Message) error
func (*HttpHandler) SendUnicast ¶
func (h *HttpHandler) SendUnicast(address string, msg transports.Message) error
func (*HttpHandler) SetBootnodes ¶
func (h *HttpHandler) SetBootnodes(bootnodes []string)
func (*HttpHandler) SetProxy ¶
func (h *HttpHandler) SetProxy(p *Proxy)
func (*HttpHandler) String ¶
func (h *HttpHandler) String() string
type HttpWsHandler ¶
type HttpWsHandler struct { Proxy *Proxy // proxy where the ws will be associated Connection *transports.Connection // the ws connection WsReadLimit int64 // contains filtered or unexported fields }
HttpWsHandler is a Mixed handler websockets/http
func NewHttpWsHandleWithWsReadLimit ¶ added in v0.1.9
func NewHttpWsHandleWithWsReadLimit(readLimit int64) *HttpWsHandler
func (*HttpWsHandler) AddNamespace ¶
func (h *HttpWsHandler) AddNamespace(namespace string) error
AddNamespace adds a new namespace to the transport
func (*HttpWsHandler) AddPeer ¶
func (h *HttpWsHandler) AddPeer(peer string) error
func (*HttpWsHandler) AddProxyHandler ¶
func (h *HttpWsHandler) AddProxyHandler(path string)
AddProxyHandler adds the current websocket handler into the Proxy
func (*HttpWsHandler) Address ¶
func (h *HttpWsHandler) Address() string
func (*HttpWsHandler) ConnectionType ¶
func (h *HttpWsHandler) ConnectionType() string
func (*HttpWsHandler) Init ¶
func (h *HttpWsHandler) Init(c *transports.Connection) error
func (*HttpWsHandler) Listen ¶
func (h *HttpWsHandler) Listen(receiver chan<- transports.Message)
func (*HttpWsHandler) Send ¶
func (h *HttpWsHandler) Send(msg transports.Message) error
func (*HttpWsHandler) SendUnicast ¶
func (h *HttpWsHandler) SendUnicast(address string, msg transports.Message) error
func (*HttpWsHandler) SetBootnodes ¶
func (h *HttpWsHandler) SetBootnodes(bootnodes []string)
func (*HttpWsHandler) SetProxy ¶
func (h *HttpWsHandler) SetProxy(p *Proxy)
func (*HttpWsHandler) String ¶
func (h *HttpWsHandler) String() string
type Proxy ¶
type Proxy struct { Conn *transports.Connection Server *chi.Mux Addr net.Addr TLSConfig *tls.Config }
Proxy represents a proxy
func (*Proxy) AddEndpoint ¶
AddEndpoint adds an endpoint representing the url where the request will be handled
func (*Proxy) AddHandler ¶
func (p *Proxy) AddHandler(path string, handler http.HandlerFunc)
AddHandler adds a HTTP handler in the proxy
func (*Proxy) AddMixedHandler ¶
func (p *Proxy) AddMixedHandler(path string, HTTPhandler http.HandlerFunc, WShandler ProxyWsHandler, WSreadLimit int64)
AddMixedHandler adds a mixed (websockets and HTTP) handler in the proxy
func (*Proxy) AddWsHTTPBridge ¶
func (p *Proxy) AddWsHTTPBridge(url string) ProxyWsHandler
AddWsHTTPBridge adds a WS endpoint to interact with the underlying web3
func (*Proxy) AddWsHandler ¶
func (p *Proxy) AddWsHandler(path string, handler ProxyWsHandler, readLimit int64)
AddWsHandler adds a websocket handler in the proxy
func (*Proxy) AddWsWsBridge ¶
func (p *Proxy) AddWsWsBridge(url string, readLimit int64) ProxyWsHandler
AddWsWsBridge adds a WS endpoint to interact with the underlying websocket server
func (*Proxy) GenerateSSLCertificate ¶
GenerateSSLCertificate generates a SSL certificated for the proxy
type ProxyWsHandler ¶
ProxyWsHandler function signature required to add a handler in the net/http Server
type WebsocketContext ¶
func (WebsocketContext) ConnectionType ¶
func (c WebsocketContext) ConnectionType() string
func (*WebsocketContext) Send ¶
func (c *WebsocketContext) Send(msg transports.Message) error
type WebsocketHandle ¶
type WebsocketHandle struct { Connection *transports.Connection // the ws connection WsProxy *Proxy // proxy where the ws will be associated ReadLimit int64 // contains filtered or unexported fields }
WebsocketHandle handles the websockets connection on the go-dvote proxy
func NewWebSocketHandleWithReadLimit ¶ added in v0.1.8
func NewWebSocketHandleWithReadLimit(readLimit int64) *WebsocketHandle
func (*WebsocketHandle) AddNamespace ¶
func (w *WebsocketHandle) AddNamespace(namespace string) error
Listen will listen the websockets handler and write the received data into the channel
func (*WebsocketHandle) AddPeer ¶
func (w *WebsocketHandle) AddPeer(peer string) error
func (*WebsocketHandle) AddProxyHandler ¶
func (w *WebsocketHandle) AddProxyHandler(path string)
AddProxyHandler adds the current websocket handler into the Proxy
func (*WebsocketHandle) Address ¶
func (w *WebsocketHandle) Address() string
func (*WebsocketHandle) ConnectionType ¶
func (w *WebsocketHandle) ConnectionType() string
ConnectionType returns a string identifying the transport connection type
func (*WebsocketHandle) Init ¶
func (w *WebsocketHandle) Init(c *transports.Connection) error
Init initializes the websockets handler and the internal channel to communicate with other go-dvote components
func (*WebsocketHandle) Listen ¶
func (w *WebsocketHandle) Listen(receiver chan<- transports.Message)
Listen will listen the websockets handler and write the received data into the channel
func (*WebsocketHandle) Send ¶
func (w *WebsocketHandle) Send(msg transports.Message) error
Send sends the response given a message
func (*WebsocketHandle) SendUnicast ¶
func (w *WebsocketHandle) SendUnicast(address string, msg transports.Message) error
func (*WebsocketHandle) SetBootnodes ¶
func (w *WebsocketHandle) SetBootnodes(bootnodes []string)
func (*WebsocketHandle) SetProxy ¶
func (w *WebsocketHandle) SetProxy(p *Proxy)
SetProxy sets the proxy for the ws
func (*WebsocketHandle) String ¶
func (w *WebsocketHandle) String() string