network

package
v0.0.0-...-45a46c7 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2019 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	BuffSize = 1 << 21
)

Variables

This section is empty.

Functions

func ByteToUint

func ByteToUint(buff []byte) uint32

func NewAesConn

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

func NewCounterConn

func NewCounterConn(conn net.Conn, counter CounterMan) net.Conn

func NewLVConn

func NewLVConn(conn net.Conn) net.Conn

func UintToByte

func UintToByte(val uint32) []byte

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 CounterConn

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

func (*CounterConn) Read

func (cc *CounterConn) Read(b []byte) (n int, err error)

func (*CounterConn) Write

func (cc *CounterConn) Write(b []byte) (n int, err error)

type CounterMan

type CounterMan interface {
	ReadCount(int) error
	WriteCount(int) 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 PipeConn

type PipeConn struct {
	IV *Salt
	net.Conn
	Block cipher.Block
}

func NewConsumerConn

func NewConsumerConn(c net.Conn, key account.PipeCryptKey) *PipeConn

func NewProducerConn

func NewProducerConn(c net.Conn, key account.PipeCryptKey) *PipeConn

func (*PipeConn) ReadCryptData

func (c *PipeConn) ReadCryptData(buf []byte) (n int, err error)

func (*PipeConn) WriteCryptData

func (c *PipeConn) WriteCryptData(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