Documentation ¶
Index ¶
- Variables
- func CreateDirectListener(Context context.Context, URL *url.URL, config *ListenerConfig) (net.Listener, []url.URL, error)
- type ListenerConfig
- type MultiListener
- func (l *MultiListener) Accept() (net.Conn, error)
- func (l *MultiListener) Addr() net.Addr
- func (l *MultiListener) AllURLs() []url.URL
- func (l *MultiListener) Close() error
- func (l *MultiListener) Initialize() error
- func (l *MultiListener) PublishToDiscoveryServer(DiscoveryServerConn net.Conn, Channel string) error
- func (l *MultiListener) RegisterListener(InnerListener net.Listener, URL []url.URL) error
Constants ¶
This section is empty.
Variables ¶
The probing interval for publisher to check the publish status. This is required in case discovery server does not send close signal.
Functions ¶
func CreateDirectListener ¶
func CreateDirectListener(Context context.Context, URL *url.URL, config *ListenerConfig) (net.Listener, []url.URL, error)
RegisterURLListener creates a listener on the given URL. This URL can only be TCP or UDP for direct access cases. Append query `enc=1` for e2e encryption (Only works on TCP).
Types ¶
type ListenerConfig ¶
type MultiListener ¶
type MultiListener struct {
// contains filtered or unexported fields
}
MultiListener is a listener wrapper mainly used to combine with discovery server.
A normal process is like:
lis := listener.New() defer lis.Close() lis.RegisterListener(innerListener, urls) lis.Initialize() lis.PublishToDiscoveryServer(conn, channel) ... conn, err := lis.Accept()
func (*MultiListener) Accept ¶
func (l *MultiListener) Accept() (net.Conn, error)
func (*MultiListener) Addr ¶
func (l *MultiListener) Addr() net.Addr
func (*MultiListener) AllURLs ¶
func (l *MultiListener) AllURLs() []url.URL
func (*MultiListener) Close ¶
func (l *MultiListener) Close() error
func (*MultiListener) Initialize ¶
func (l *MultiListener) Initialize() error
Click to show internal directories.
Click to hide internal directories.