Documentation ¶
Index ¶
- Constants
- type Conner
- type GorillaDialWrapper
- type GorillaUpgradeWrapper
- type GorillaWebsocketDialerForDialer
- type GorillaWebsocketUpgraderForListener
- type HTTPServerForListener
- type HTTPServerWrapper
- func (s HTTPServerWrapper) Close() error
- func (s HTTPServerWrapper) Serve(l net.Listener) error
- func (s HTTPServerWrapper) ServeTLS(l net.Listener, certFile string, keyFile string) error
- func (s HTTPServerWrapper) SetHandeler(mux *http.ServeMux)
- func (s HTTPServerWrapper) SetTLSConfig(tlscfg *tls.Config)
- type NullBackendCfg
- type TCPDialer
- type TCPDialerCfg
- type TCPListener
- type TCPListenerCfg
- func (cfg TCPListenerCfg) GetAddr() string
- func (cfg TCPListenerCfg) GetCost() float64
- func (cfg TCPListenerCfg) GetNodeCost() map[string]float64
- func (cfg TCPListenerCfg) GetTLS() string
- func (cfg TCPListenerCfg) PreReload() error
- func (cfg TCPListenerCfg) Prepare() error
- func (cfg TCPListenerCfg) Reload() error
- func (cfg TCPListenerCfg) Run() error
- type TCPSession
- type UDPDialer
- type UDPDialerCfg
- type UDPDialerSession
- type UDPListener
- type UDPListenerCfg
- func (cfg UDPListenerCfg) GetAddr() string
- func (cfg UDPListenerCfg) GetCost() float64
- func (cfg UDPListenerCfg) GetNodeCost() map[string]float64
- func (cfg UDPListenerCfg) GetPort() int
- func (cfg UDPListenerCfg) GetTLS() string
- func (cfg UDPListenerCfg) PreReload() error
- func (cfg UDPListenerCfg) Prepare() error
- func (cfg UDPListenerCfg) Reload() error
- func (cfg UDPListenerCfg) Run() error
- type UDPListenerSession
- type WebsocketDialer
- func (b *WebsocketDialer) Dialer(dialer GorillaWebsocketDialerForDialer) GorillaWebsocketDialerForDialer
- func (b *WebsocketDialer) GetAddr() string
- func (b *WebsocketDialer) GetTLS() *tls.Config
- func (b *WebsocketDialer) Start(ctx context.Context, wg *sync.WaitGroup) (chan netceptor.BackendSession, error)
- type WebsocketDialerCfg
- type WebsocketListener
- func (b *WebsocketListener) Addr() net.Addr
- func (b *WebsocketListener) GetAddr() string
- func (b *WebsocketListener) GetTLS() *tls.Config
- func (b *WebsocketListener) Path() string
- func (b *WebsocketListener) SetPath(path string)
- func (b *WebsocketListener) Start(ctx context.Context, wg *sync.WaitGroup) (chan netceptor.BackendSession, error)
- type WebsocketListenerCfg
- func (cfg WebsocketListenerCfg) GetAddr() string
- func (cfg WebsocketListenerCfg) GetCost() float64
- func (cfg WebsocketListenerCfg) GetNodeCost() map[string]float64
- func (cfg WebsocketListenerCfg) GetTLS() string
- func (cfg WebsocketListenerCfg) PreReload() error
- func (cfg WebsocketListenerCfg) Prepare() error
- func (cfg WebsocketListenerCfg) Reload() error
- func (cfg WebsocketListenerCfg) Run() error
- type WebsocketListenerForWebsocket
- type WebsocketSession
Constants ¶
const UDPMaxPacketLen = 65507
UDPMaxPacketLen is the maximum size of a message that can be sent over UDP.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GorillaDialWrapper ¶ added in v1.4.3
type GorillaDialWrapper struct {
// contains filtered or unexported fields
}
GorillaDialWrapper represents the real library.
type GorillaUpgradeWrapper ¶ added in v1.4.3
type GorillaUpgradeWrapper struct {
// contains filtered or unexported fields
}
GorillaDialWrapper represents the real library.
type GorillaWebsocketDialerForDialer ¶ added in v1.4.3
type GorillaWebsocketUpgraderForListener ¶ added in v1.4.3
type HTTPServerForListener ¶ added in v1.4.3
type HTTPServerWrapper ¶ added in v1.4.3
type HTTPServerWrapper struct {
// contains filtered or unexported fields
}
func (HTTPServerWrapper) Close ¶ added in v1.4.3
func (s HTTPServerWrapper) Close() error
func (HTTPServerWrapper) Serve ¶ added in v1.4.3
func (s HTTPServerWrapper) Serve(l net.Listener) error
func (HTTPServerWrapper) SetHandeler ¶ added in v1.4.3
func (s HTTPServerWrapper) SetHandeler(mux *http.ServeMux)
func (HTTPServerWrapper) SetTLSConfig ¶ added in v1.4.3
func (s HTTPServerWrapper) SetTLSConfig(tlscfg *tls.Config)
type NullBackendCfg ¶ added in v1.4.9
type NullBackendCfg struct {
Local bool
}
func (*NullBackendCfg) GetAddr ¶ added in v1.4.9
func (cfg *NullBackendCfg) GetAddr() string
func (*NullBackendCfg) GetTLS ¶ added in v1.4.9
func (cfg *NullBackendCfg) GetTLS() *tls.Config
func (NullBackendCfg) Reload ¶ added in v1.4.9
func (cfg NullBackendCfg) Reload() error
func (NullBackendCfg) Run ¶ added in v1.4.9
func (cfg NullBackendCfg) Run() error
Run runs the action, in this case adding a null backend to keep the wait group alive.
func (NullBackendCfg) Start ¶ added in v1.4.9
func (cfg NullBackendCfg) Start(_ context.Context, _ *sync.WaitGroup) (chan netceptor.BackendSession, error)
make the nullBackendCfg object be usable as a do-nothing Backend.
type TCPDialer ¶
type TCPDialer struct {
// contains filtered or unexported fields
}
TCPDialer implements Backend for outbound TCP.
func NewTCPDialer ¶
func NewTCPDialer(address string, redial bool, tls *tls.Config, logger *logger.ReceptorLogger) (*TCPDialer, error)
NewTCPDialer instantiates a new TCP backend.
type TCPDialerCfg ¶ added in v1.4.0
type TCPDialerCfg struct { Address string `description:"Remote address (Host:Port) to connect to" barevalue:"yes" required:"yes"` Redial bool `description:"Keep redialing on lost connection" default:"true"` TLS string `description:"Name of TLS client config"` Cost float64 `description:"Connection cost (weight)" default:"1.0"` AllowedPeers []string `description:"Peer node IDs to allow via this connection"` }
TODO make these fields private TCPDialerCfg is the cmdline configuration object for a TCP dialer.
func (TCPDialerCfg) PreReload ¶ added in v1.4.0
func (cfg TCPDialerCfg) PreReload() error
func (TCPDialerCfg) Prepare ¶ added in v1.4.0
func (cfg TCPDialerCfg) Prepare() error
Prepare verifies the parameters are correct.
func (TCPDialerCfg) Reload ¶ added in v1.4.0
func (cfg TCPDialerCfg) Reload() error
type TCPListener ¶
TCPListener implements Backend for inbound TCP.
func NewTCPListener ¶
func NewTCPListener(address string, tls *tls.Config, logger *logger.ReceptorLogger) (*TCPListener, error)
NewTCPListener instantiates a new TCPListener backend.
func (*TCPListener) GetAddr ¶ added in v1.4.0
func (b *TCPListener) GetAddr() string
Addr returns the network address the listener is listening on.
func (*TCPListener) GetCost ¶ added in v1.4.0
func (b *TCPListener) GetCost() string
func (*TCPListener) GetTLS ¶ added in v1.4.0
func (b *TCPListener) GetTLS() *tls.Config
func (*TCPListener) Start ¶
func (b *TCPListener) Start(ctx context.Context, wg *sync.WaitGroup) (chan netceptor.BackendSession, error)
Start runs the given session function over the TCPListener backend.
type TCPListenerCfg ¶ added in v1.4.0
type TCPListenerCfg struct { BindAddr string `description:"Local address to bind to" default:"0.0.0.0"` Port int `description:"Local TCP port to listen on" barevalue:"yes" required:"yes"` TLS string `description:"Name of TLS server config"` Cost float64 `description:"Connection cost (weight)" default:"1.0"` NodeCost map[string]float64 `description:"Per-node costs"` AllowedPeers []string `description:"Peer node IDs to allow via this connection"` }
TODO make these fields private TCPListenerCfg is the cmdline configuration object for a TCP listener.
func (TCPListenerCfg) GetAddr ¶ added in v1.4.0
func (cfg TCPListenerCfg) GetAddr() string
func (TCPListenerCfg) GetCost ¶ added in v1.4.0
func (cfg TCPListenerCfg) GetCost() float64
func (TCPListenerCfg) GetNodeCost ¶ added in v1.4.0
func (cfg TCPListenerCfg) GetNodeCost() map[string]float64
func (TCPListenerCfg) GetTLS ¶ added in v1.4.0
func (cfg TCPListenerCfg) GetTLS() string
func (TCPListenerCfg) PreReload ¶ added in v1.4.0
func (cfg TCPListenerCfg) PreReload() error
func (TCPListenerCfg) Prepare ¶ added in v1.4.0
func (cfg TCPListenerCfg) Prepare() error
Prepare verifies the parameters are correct.
func (TCPListenerCfg) Reload ¶ added in v1.4.0
func (cfg TCPListenerCfg) Reload() error
func (TCPListenerCfg) Run ¶ added in v1.4.0
func (cfg TCPListenerCfg) Run() error
Run runs the action.
type TCPSession ¶
type TCPSession struct {
// contains filtered or unexported fields
}
TCPSession implements BackendSession for TCP backend.
func (*TCPSession) Recv ¶
func (ns *TCPSession) Recv(timeout time.Duration) ([]byte, error)
Recv receives data via the session.
func (*TCPSession) Send ¶
func (ns *TCPSession) Send(data []byte) error
Send sends data over the session.
type UDPDialer ¶
type UDPDialer struct {
// contains filtered or unexported fields
}
UDPDialer implements Backend for outbound UDP.
func NewUDPDialer ¶
NewUDPDialer instantiates a new UDPDialer backend.
type UDPDialerCfg ¶ added in v1.4.9
type UDPDialerCfg struct { Address string `description:"Host:Port to connect to" barevalue:"yes" required:"yes"` Redial bool `description:"Keep redialing on lost connection" default:"true"` Cost float64 `description:"Connection cost (weight)" default:"1.0"` AllowedPeers []string `description:"Peer node IDs to allow via this connection"` }
udpDialerCfg is the cmdline configuration object for a UDP listener.
func (UDPDialerCfg) PreReload ¶ added in v1.4.9
func (cfg UDPDialerCfg) PreReload() error
func (UDPDialerCfg) Prepare ¶ added in v1.4.9
func (cfg UDPDialerCfg) Prepare() error
Prepare verifies the parameters are correct.
func (UDPDialerCfg) Reload ¶ added in v1.4.9
func (cfg UDPDialerCfg) Reload() error
type UDPDialerSession ¶
type UDPDialerSession struct {
// contains filtered or unexported fields
}
UDPDialerSession implements BackendSession for UDPDialer.
func (*UDPDialerSession) Close ¶
func (ns *UDPDialerSession) Close() error
Close closes the session.
func (*UDPDialerSession) Recv ¶
func (ns *UDPDialerSession) Recv(timeout time.Duration) ([]byte, error)
Recv receives data via the session.
func (*UDPDialerSession) Send ¶
func (ns *UDPDialerSession) Send(data []byte) error
Send sends data over the session.
type UDPListener ¶
type UDPListener struct {
// contains filtered or unexported fields
}
UDPListener implements Backend for inbound UDP.
func NewUDPListener ¶
func NewUDPListener(address string, logger *logger.ReceptorLogger) (*UDPListener, error)
NewUDPListener instantiates a new UDPListener backend.
func (*UDPListener) GetAddr ¶ added in v1.4.0
func (b *UDPListener) GetAddr() string
func (*UDPListener) GetTLS ¶ added in v1.4.0
func (b *UDPListener) GetTLS() *tls.Config
func (*UDPListener) LocalAddr ¶
func (b *UDPListener) LocalAddr() net.Addr
LocalAddr returns the local address the listener is listening on.
func (*UDPListener) Start ¶
func (b *UDPListener) Start(ctx context.Context, wg *sync.WaitGroup) (chan netceptor.BackendSession, error)
Start runs the given session function over the UDPListener backend.
type UDPListenerCfg ¶ added in v1.4.0
type UDPListenerCfg struct { BindAddr string `description:"Local address to bind to" default:"0.0.0.0"` Port int `description:"Local UDP port to listen on" barevalue:"yes" required:"yes"` Cost float64 `description:"Connection cost (weight)" default:"1.0"` NodeCost map[string]float64 `description:"Per-node costs"` AllowedPeers []string `description:"Peer node IDs to allow via this connection"` }
TODO make these fields private UDPListenerCfg is the cmdline configuration object for a UDP listener.
func (UDPListenerCfg) GetAddr ¶ added in v1.4.0
func (cfg UDPListenerCfg) GetAddr() string
func (UDPListenerCfg) GetCost ¶ added in v1.4.0
func (cfg UDPListenerCfg) GetCost() float64
func (UDPListenerCfg) GetNodeCost ¶ added in v1.4.0
func (cfg UDPListenerCfg) GetNodeCost() map[string]float64
func (UDPListenerCfg) GetPort ¶ added in v1.4.0
func (cfg UDPListenerCfg) GetPort() int
func (UDPListenerCfg) GetTLS ¶ added in v1.4.0
func (cfg UDPListenerCfg) GetTLS() string
func (UDPListenerCfg) PreReload ¶ added in v1.4.0
func (cfg UDPListenerCfg) PreReload() error
func (UDPListenerCfg) Prepare ¶ added in v1.4.0
func (cfg UDPListenerCfg) Prepare() error
Prepare verifies the parameters are correct.
func (UDPListenerCfg) Reload ¶ added in v1.4.0
func (cfg UDPListenerCfg) Reload() error
func (UDPListenerCfg) Run ¶ added in v1.4.0
func (cfg UDPListenerCfg) Run() error
Run runs the action.
type UDPListenerSession ¶
type UDPListenerSession struct {
// contains filtered or unexported fields
}
UDPListenerSession implements BackendSession for UDPListener.
func (*UDPListenerSession) Close ¶
func (ns *UDPListenerSession) Close() error
Close closes the session.
func (*UDPListenerSession) Recv ¶
func (ns *UDPListenerSession) Recv(timeout time.Duration) ([]byte, error)
Recv receives data from the session.
func (*UDPListenerSession) Send ¶
func (ns *UDPListenerSession) Send(data []byte) error
Send sends data over the session.
type WebsocketDialer ¶
type WebsocketDialer struct {
// contains filtered or unexported fields
}
WebsocketDialer implements Backend for outbound Websocket.
func NewWebsocketDialer ¶
func NewWebsocketDialer(address string, tlscfg *tls.Config, extraHeader string, redial bool, logger *logger.ReceptorLogger, dialer GorillaWebsocketDialerForDialer) (*WebsocketDialer, error)
NewWebsocketDialer instantiates a new WebsocketDialer backend.
func (*WebsocketDialer) Dialer ¶ added in v1.4.3
func (b *WebsocketDialer) Dialer(dialer GorillaWebsocketDialerForDialer) GorillaWebsocketDialerForDialer
func (*WebsocketDialer) GetAddr ¶ added in v1.4.0
func (b *WebsocketDialer) GetAddr() string
func (*WebsocketDialer) GetTLS ¶ added in v1.4.0
func (b *WebsocketDialer) GetTLS() *tls.Config
func (*WebsocketDialer) Start ¶
func (b *WebsocketDialer) Start(ctx context.Context, wg *sync.WaitGroup) (chan netceptor.BackendSession, error)
Start runs the given session function over this backend service.
type WebsocketDialerCfg ¶ added in v1.4.9
type WebsocketDialerCfg struct { Address string `description:"URL to connect to" barevalue:"yes" required:"yes"` Redial bool `description:"Keep redialing on lost connection" default:"true"` ExtraHeader string `description:"Sends extra HTTP header on initial connection"` TLS string `description:"Name of TLS client config"` Cost float64 `description:"Connection cost (weight)" default:"1.0"` AllowedPeers []string `description:"Peer node IDs to allow via this connection"` }
websocketDialerCfg is the cmdline configuration object for a Websocket listener.
func (WebsocketDialerCfg) PreReload ¶ added in v1.4.9
func (cfg WebsocketDialerCfg) PreReload() error
func (WebsocketDialerCfg) Prepare ¶ added in v1.4.9
func (cfg WebsocketDialerCfg) Prepare() error
Prepare verifies that we are reasonably ready to go.
func (WebsocketDialerCfg) Reload ¶ added in v1.4.9
func (cfg WebsocketDialerCfg) Reload() error
func (WebsocketDialerCfg) Run ¶ added in v1.4.9
func (cfg WebsocketDialerCfg) Run() error
Run runs the action.
type WebsocketListener ¶
type WebsocketListener struct {
// contains filtered or unexported fields
}
WebsocketListener implements Backend for inbound Websocket.
func NewWebsocketListener ¶
func NewWebsocketListener(address string, tlscfg *tls.Config, logger *logger.ReceptorLogger, upgrader GorillaWebsocketUpgraderForListener, server HTTPServerForListener) (*WebsocketListener, error)
NewWebsocketListener instantiates a new WebsocketListener backend.
func (*WebsocketListener) Addr ¶
func (b *WebsocketListener) Addr() net.Addr
Addr returns the network address the listener is listening on.
func (*WebsocketListener) GetAddr ¶ added in v1.4.0
func (b *WebsocketListener) GetAddr() string
func (*WebsocketListener) GetTLS ¶ added in v1.4.0
func (b *WebsocketListener) GetTLS() *tls.Config
func (*WebsocketListener) Path ¶
func (b *WebsocketListener) Path() string
Path returns the URI path the websocket is configured on.
func (*WebsocketListener) SetPath ¶
func (b *WebsocketListener) SetPath(path string)
SetPath sets the URI path that the listener will be hosted on. It is only effective if used prior to calling Start.
func (*WebsocketListener) Start ¶
func (b *WebsocketListener) Start(ctx context.Context, wg *sync.WaitGroup) (chan netceptor.BackendSession, error)
Start runs the given session function over the WebsocketListener backend.
type WebsocketListenerCfg ¶ added in v1.4.0
type WebsocketListenerCfg struct { BindAddr string `description:"Local address to bind to" default:"0.0.0.0"` Port int `description:"Local TCP port to run http server on" barevalue:"yes" required:"yes"` Path string `description:"URI path to the websocket server" default:"/"` TLS string `description:"Name of TLS server config"` Cost float64 `description:"Connection cost (weight)" default:"1.0"` NodeCost map[string]float64 `description:"Per-node costs"` AllowedPeers []string `description:"Peer node IDs to allow via this connection"` }
TODO make fields private WebsocketListenerCfg is the cmdline configuration object for a websocket listener.
func (WebsocketListenerCfg) GetAddr ¶ added in v1.4.0
func (cfg WebsocketListenerCfg) GetAddr() string
func (WebsocketListenerCfg) GetCost ¶ added in v1.4.0
func (cfg WebsocketListenerCfg) GetCost() float64
func (WebsocketListenerCfg) GetNodeCost ¶ added in v1.4.0
func (cfg WebsocketListenerCfg) GetNodeCost() map[string]float64
func (WebsocketListenerCfg) GetTLS ¶ added in v1.4.0
func (cfg WebsocketListenerCfg) GetTLS() string
func (WebsocketListenerCfg) PreReload ¶ added in v1.4.0
func (cfg WebsocketListenerCfg) PreReload() error
func (WebsocketListenerCfg) Prepare ¶ added in v1.4.0
func (cfg WebsocketListenerCfg) Prepare() error
Prepare verifies the parameters are correct.
func (WebsocketListenerCfg) Reload ¶ added in v1.4.0
func (cfg WebsocketListenerCfg) Reload() error
func (WebsocketListenerCfg) Run ¶ added in v1.4.0
func (cfg WebsocketListenerCfg) Run() error
Run runs the action.
type WebsocketListenerForWebsocket ¶ added in v1.4.3
type WebsocketSession ¶
type WebsocketSession struct {
// contains filtered or unexported fields
}
WebsocketSession implements BackendSession for WebsocketDialer and WebsocketListener.
func (*WebsocketSession) Close ¶
func (ns *WebsocketSession) Close() error
Close closes the session.
func (*WebsocketSession) Recv ¶
func (ns *WebsocketSession) Recv(timeout time.Duration) ([]byte, error)
Recv receives data via the session.
func (*WebsocketSession) Send ¶
func (ns *WebsocketSession) Send(data []byte) error
Send sends data over the session.
Directories ¶
Path | Synopsis |
---|---|
Package mock_backends is a generated GoMock package.
|
Package mock_backends is a generated GoMock package. |