Documentation ¶
Index ¶
- Constants
- Variables
- func Get() (lazySlice, []byte)
- func NewConn(conn net.Conn, cipher *Cipher) net.Conn
- func NewPacketConn(pc net.PacketConn, cipher *Cipher) net.PacketConn
- func Pack(dst, pkt []byte, cipher *Cipher) ([]byte, error)
- func Put(s lazySlice)
- func Unpack(dst, pkt []byte, cipher *Cipher) ([]byte, error)
- type Cipher
- type CloseReader
- type CloseWriter
- type Conn
- type Key
- type PacketConn
- type Reader
- type Writer
Constants ¶
View Source
const MaxPacketSize = 0x3FFF // 16k - 1
MaxPacketSize is ... the maximum size of payload
Variables ¶
View Source
var ErrShortPacket = errors.New("short packet")
ErrShortPacket is ...
View Source
var Pool = sync.Pool{ New: func() interface{} { b := make([]byte, MaxPacketSize) return &b }, }
Pool is ...
Functions ¶
func NewPacketConn ¶
func NewPacketConn(pc net.PacketConn, cipher *Cipher) net.PacketConn
NewPacketConn is ...
Types ¶
type Cipher ¶
type Cipher struct { // KeySize is ... KeySize int // SaltSize is ... SaltSize int // NewAEAD is ... NewAEAD func([]byte) (cipher.AEAD, error) }
Cipher is ...
type Conn ¶
type Conn struct { // Reader is ... Reader // Writer is ... Writer // contains filtered or unexported fields }
Conn is ...
func (*Conn) RemoteAddr ¶
type Key ¶
type Key []byte
Key is ...
type PacketConn ¶
type PacketConn struct { net.PacketConn Cipher *Cipher }
PacketConn is ...
type Reader ¶
type Reader struct { // Reader is ... Reader io.ReadCloser // Cipher is ... Cipher *Cipher // AEAD is ... AEAD cipher.AEAD // contains filtered or unexported fields }
Reader is ...
Click to show internal directories.
Click to hide internal directories.