Documentation
¶
Index ¶
- Constants
- func CompleteAddress(address, proto string) (string, error)
- func GetAddress(protoAddr string) (proto string, address string, err error)
- type BytesReader
- func (r *BytesReader) Discard(n int) (discarded int, err error)
- func (r *BytesReader) InboundBuffered() int
- func (r *BytesReader) Next(n int) (buf []byte, err error)
- func (r *BytesReader) Peek(n int) (buf []byte, err error)
- func (r *BytesReader) Read(p []byte) (n int, err error)
- func (r *BytesReader) WriteTo(w io.Writer) (n int64, err error)
Constants ¶
View Source
const ( ProtoTCP = "tcp" ProtoUDP = "udp" ProtoWebsocket = "ws" )
Variables ¶
This section is empty.
Functions ¶
func CompleteAddress ¶
CompleteAddress
@Description: 补完地址 @param address 原始地址,格式如 `192.168.0.10:9851` 或 `tcp://192.168.0.10:9851` @param proto 协议,如 `tcp`、`udp` @return string 地址格式如 `tcp://192.168.0.10:9851` @return error
Types ¶
type BytesReader ¶ added in v0.0.12
type BytesReader struct {
// contains filtered or unexported fields
}
func NewBytesReader ¶ added in v0.0.12
func NewBytesReader(data []byte) *BytesReader
func (*BytesReader) Discard ¶ added in v0.0.12
func (r *BytesReader) Discard(n int) (discarded int, err error)
func (*BytesReader) InboundBuffered ¶ added in v0.0.12
func (r *BytesReader) InboundBuffered() int
func (*BytesReader) Next ¶ added in v0.0.12
func (r *BytesReader) Next(n int) (buf []byte, err error)
Click to show internal directories.
Click to hide internal directories.