tcp

package
v0.0.0-...-50c083d Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTCPListener

func NewTCPListener(port string, tlsConfig ...*tls.Config) (net.Listener, error)

Types

type Client

type Client struct {
	ServerAddr string
}

func NewTCPClient

func NewTCPClient(serverAddr string) *Client

func (*Client) Connect

func (c *Client) Connect(clientProcessingFunc ClientProcessor)

func (*Client) ConsulConnect

func (c *Client) ConsulConnect(consul *sd.Consul, clientProcessingFunc ClientProcessor)

type ClientProcessor

type ClientProcessor func(conn net.Conn)

type Forwarder

type Forwarder struct {
	Name            string
	LocalAddr       string
	RemoteAddresses []string
	HealtcheckAddr  string
}

func NewTCPForwarder

func NewTCPForwarder(name string, localAddr string, remoteAddresses []string, healthcheckAddr string) *Forwarder

func (*Forwarder) Accept

func (f *Forwarder) Accept()

type Server

type Server struct {
	Name     string
	Port     string
	Listener net.Listener
}

func NewTCPServer

func NewTCPServer(name string, port string, listener net.Listener) *Server

func (*Server) Accept

func (s *Server) Accept(serverProcessingFunc ServerProcessor)

type ServerProcessor

type ServerProcessor func(conn net.Conn)

Jump to

Keyboard shortcuts

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