proxy

package
v0.0.0-...-c327e57 Latest Latest
Warning

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

Go to latest
Published: May 4, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KindPing string = "ping"
	KindPong string = "pong"
	KindMSG  string = "msg"

	DeadlineWrite = 10 * time.Second
	DeadlineRead  = 5 * time.Second

	DefaultServer = ":2963"
	DefaultHost   = "127.0.0.1"
	DefaultPort   = 2963
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	io.Writer
	// contains filtered or unexported fields
}

func NewClient

func NewClient(name, addr string, handler Handler) *Client

func (*Client) Connect

func (p *Client) Connect() error

func (*Client) Ping

func (p *Client) Ping() error

func (*Client) Pong

func (p *Client) Pong() error

func (*Client) Reconnect

func (p *Client) Reconnect(addr string)

func (*Client) Send

func (p *Client) Send(data []byte) error

func (*Client) Write

func (p *Client) Write(msg []byte) error

type Conn

type Conn struct {
	net.Conn

	IdleTimeout time.Duration
	// contains filtered or unexported fields
}

func (*Conn) Handle

func (c *Conn) Handle(handler Handler)

func (*Conn) Ping

func (c *Conn) Ping() error

func (*Conn) Pong

func (c *Conn) Pong() error

func (*Conn) Send

func (c *Conn) Send(data []byte) error

func (*Conn) Write

func (c *Conn) Write(p []byte) (int, error)

type Handler

type Handler func(message types.ProxyMessage) error

type Server

type Server struct {
	Addr        string
	IdleTimeout time.Duration
	// contains filtered or unexported fields
}

func NewServer

func NewServer(addr string) (*Server, error)

func (Server) Listen

func (srv Server) Listen(handler Handler) error

Jump to

Keyboard shortcuts

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