Documentation
¶
Index ¶
- Constants
- Variables
- func InitTrafficChannel(up, down func(int64, int))
- type BufferConn
- type DefaultConn
- func (c *DefaultConn) Close() error
- func (c *DefaultConn) Context() context.Context
- func (c *DefaultConn) Flush() (int, error)
- func (c *DefaultConn) GetID() int64
- func (c *DefaultConn) GetNetwork() string
- func (c *DefaultConn) GetRecordID() int64
- func (c *DefaultConn) Read(b []byte) (n int, err error)
- func (c *DefaultConn) SetContext(ctx context.Context)
- func (c *DefaultConn) SetRecordID(id int64)
- func (c *DefaultConn) Write(b []byte) (n int, err error)
- type IConn
- func BufferDecorate(c IConn) (IConn, error)
- func DefaultDecorate(c net.Conn, network string) (IConn, error)
- func DefaultDecorateForTls(c net.Conn, network string, id int64) (IConn, error)
- func DirectConn(network, host string) (IConn, error)
- func NewDefaultConn(conn net.Conn, network string) (IConn, error)
- func RealTimeDecorate(c IConn) (IConn, error)
- func TimerDecorate(c IConn, rto, wto time.Duration) (IConn, error)
- func TrafficDecorate(c IConn) (IConn, error)
- type RealTimeFlush
- type TimerConn
- type Traffic
Constants ¶
View Source
const ( TCP = "tcp" UDP = "udp" )
Variables ¶
View Source
var DefaultTimeOut = 10 * time.Second
Functions ¶
func InitTrafficChannel ¶
Types ¶
type BufferConn ¶
type BufferConn struct { IConn // contains filtered or unexported fields }
func (*BufferConn) Flush ¶
func (c *BufferConn) Flush() (n int, err error)
type DefaultConn ¶
type DefaultConn struct { net.Conn ID int64 RecordID int64 Network string // contains filtered or unexported fields }
func (*DefaultConn) Close ¶
func (c *DefaultConn) Close() error
func (*DefaultConn) Context ¶
func (c *DefaultConn) Context() context.Context
func (*DefaultConn) Flush ¶
func (c *DefaultConn) Flush() (int, error)
func (*DefaultConn) GetID ¶
func (c *DefaultConn) GetID() int64
func (*DefaultConn) GetNetwork ¶
func (c *DefaultConn) GetNetwork() string
func (*DefaultConn) GetRecordID ¶
func (c *DefaultConn) GetRecordID() int64
func (*DefaultConn) SetContext ¶
func (c *DefaultConn) SetContext(ctx context.Context)
func (*DefaultConn) SetRecordID ¶
func (c *DefaultConn) SetRecordID(id int64)
type IConn ¶
type IConn interface { net.Conn GetID() int64 GetRecordID() int64 SetRecordID(id int64) GetNetwork() string Flush() (int, error) Context() context.Context SetContext(context.Context) }
func DefaultDecorateForTls ¶
func DirectConn ¶
func TrafficDecorate ¶
type RealTimeFlush ¶
type RealTimeFlush struct {
IConn
}
Click to show internal directories.
Click to hide internal directories.