network

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	BuffSize      = 1 << 21
	StructBufSize = 1 << 16
)

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) ReadJsonMsg

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

func (*JsonConn) Syn

func (conn *JsonConn) Syn(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
}

func (*LVConn) Read

func (lc *LVConn) Read(buf []byte) (n int, err 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