Documentation ¶
Index ¶
- Constants
- Variables
- type AddrType
- type Address
- type CommandCallback
- type DisconnectCallback
- type ErrorCallback
- type TunlConn
- func (t *TunlConn) Close() error
- func (t *TunlConn) HandleConnection()
- func (t *TunlConn) HandleExpire()
- func (t *TunlConn) Read() ([]byte, error)
- func (t *TunlConn) Send(m proto.Message) (n int, err error)
- func (t *TunlConn) SetExpireAt(e time.Time)
- func (t *TunlConn) SetOnCommand(c CommandCallback)
- func (t *TunlConn) SetOnDisconnected(c DisconnectCallback)
- func (t *TunlConn) SetOnError(c ErrorCallback)
- func (t *TunlConn) Write(data []byte) (n int, err error)
Constants ¶
View Source
const ( ErrorServerFull int32 = 2000 + iota ErrorSessionExpired ErrorClientResponse ErrorServerRequest )
View Source
const ReaderSize = 1 << 20
Variables ¶
View Source
var ErrorConnectionClosed = errors.New("connection closed")
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct {
// contains filtered or unexported fields
}
func NewAddress ¶
func (Address) ToProtoString ¶
type CommandCallback ¶
type DisconnectCallback ¶
type DisconnectCallback func()
type ErrorCallback ¶
type ErrorCallback func(err error)
type TunlConn ¶
type TunlConn struct { ID string Conn net.Conn ExpireAt time.Time ConnectedAt time.Time IsClosed bool // contains filtered or unexported fields }
func NewTunlConn ¶
func (*TunlConn) HandleConnection ¶
func (t *TunlConn) HandleConnection()
func (*TunlConn) HandleExpire ¶
func (t *TunlConn) HandleExpire()
func (*TunlConn) SetExpireAt ¶
func (*TunlConn) SetOnCommand ¶
func (t *TunlConn) SetOnCommand(c CommandCallback)
func (*TunlConn) SetOnDisconnected ¶
func (t *TunlConn) SetOnDisconnected(c DisconnectCallback)
func (*TunlConn) SetOnError ¶
func (t *TunlConn) SetOnError(c ErrorCallback)
Click to show internal directories.
Click to hide internal directories.