net

package
v0.0.0-...-67ab23a Latest Latest
Warning

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

Go to latest
Published: May 26, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LineReader

type LineReader struct {
	// contains filtered or unexported fields
}

func (*LineReader) Read

func (r *LineReader) Read(c *TCPClient) ([]byte, []byte, error)

type Parser

type Parser interface {
	Register(args ...interface{}) error
	SetHandler(h func(interface{}), args ...interface{}) error
	Unmarshal(data []byte) (v interface{}, err error)
	Marshal(v interface{}) (data []byte, err error)
}

type ProtobufParser

type ProtobufParser struct {
	// contains filtered or unexported fields
}

func (*ProtobufParser) Marshal

func (p *ProtobufParser) Marshal(v interface{}) (data []byte, err error)

func (*ProtobufParser) Register

func (p *ProtobufParser) Register(args ...interface{}) error

func (*ProtobufParser) SetHandler

func (p *ProtobufParser) SetHandler(h func(v interface{}), args ...interface{}) error

func (*ProtobufParser) Unmarshal

func (p *ProtobufParser) Unmarshal(data []byte) (v interface{}, err error)

type ProtobufReader

type ProtobufReader struct {
}

func (*ProtobufReader) Read

func (r *ProtobufReader) Read(c *TCPClient) ([]byte, []byte, error)

type ProtobufWriter

type ProtobufWriter struct {
}

func (*ProtobufWriter) Write

func (w *ProtobufWriter) Write(c *TCPClient, v interface{}) (data []byte, err error)

type Reader

type Reader interface {
	Read(c *TCPClient) ([]byte, []byte, error)
}

type StringParser

type StringParser struct {
	// contains filtered or unexported fields
}

func (*StringParser) Marshal

func (p *StringParser) Marshal(v interface{}) (data []byte, err error)

func (*StringParser) Register

func (p *StringParser) Register(args ...interface{}) error

func (*StringParser) SetHandler

func (p *StringParser) SetHandler(h func(interface{}), args ...interface{}) error

func (*StringParser) Unmarshal

func (p *StringParser) Unmarshal(data []byte) (v interface{}, err error)

type StringWriter

type StringWriter struct {
}

func (*StringWriter) Write

func (w *StringWriter) Write(c *TCPClient, v interface{}) (data []byte, err error)

type TCPClient

type TCPClient struct {
	Addr string

	CloseListen func()

	ReceivedCount int
	// contains filtered or unexported fields
}

func (*TCPClient) Close

func (c *TCPClient) Close() error

func (*TCPClient) Connect

func (c *TCPClient) Connect() error

func (*TCPClient) GetParser

func (c *TCPClient) GetParser() Parser

func (*TCPClient) GetReader

func (c *TCPClient) GetReader() Reader

func (*TCPClient) IsConnected

func (c *TCPClient) IsConnected() bool

func (*TCPClient) SetParser

func (c *TCPClient) SetParser(parser Parser)

func (*TCPClient) SetReader

func (c *TCPClient) SetReader(reader Reader)

func (*TCPClient) Write

func (c *TCPClient) Write(data []byte) ([]byte, error)

func (*TCPClient) WriteData

func (c *TCPClient) WriteData(v interface{}) ([]byte, error)

type Writer

type Writer interface {
	Write(*TCPClient, interface{}) (data []byte, err error)
}

Jump to

Keyboard shortcuts

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