network

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: BSD-3-Clause Imports: 9 Imported by: 6

Documentation

Index

Constants

View Source
const (
	MTU     = 1 << 24
	LenSize = 4
)

Variables

This section is empty.

Functions

func NewAesConn

func NewAesConn(conn net.Conn, key []byte, iv Salt) (net.Conn, error)

func NewLVConn

func NewLVConn(conn net.Conn) net.Conn

Types

type ACK

type ACK struct {
	Success bool
	Message string
}

type AesConn

type AesConn struct {
	net.Conn
	// contains filtered or unexported fields
}

func (*AesConn) Read

func (ac *AesConn) Read(buf []byte) (n int, err error)

func (*AesConn) Write

func (ac *AesConn) Write(buf []byte) (n int, err error)

type JsonConn

type JsonConn struct {
	net.Conn
}

func DialJson

func DialJson(network, address string) (*JsonConn, error)

func (*JsonConn) ReadJsonBuffer added in v1.0.4

func (conn *JsonConn) ReadJsonBuffer(buff []byte, v interface{}) error

func (*JsonConn) SynBuffer added in v1.0.4

func (conn *JsonConn) SynBuffer(buff []byte, v interface{}) error

func (*JsonConn) WriteAck

func (conn *JsonConn) WriteAck(err error)

func (*JsonConn) WriteJsonMsg

func (conn *JsonConn) WriteJsonMsg(v interface{}) error

type LVConn

type LVConn struct {
	net.Conn
	// contains filtered or unexported fields
}

func (*LVConn) Read

func (lc *LVConn) Read(buf []byte) (int, error)

func (*LVConn) Write

func (lc *LVConn) Write(buf []byte) (n int, err error)

type Salt

type Salt [aes.BlockSize]byte

func NewSalt

func NewSalt() *Salt

Jump to

Keyboard shortcuts

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