conn

package
v1.6.8 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 10 Imported by: 2

Documentation

Overview

Package conn makes it possible to hide the structure of the true message by encrypting and adding random bytes.

NETWORK CONN FORMAT

L(M) || M
where
	L - length (uint64)
	M - message bytes

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrReadFromSocket      = &SConnError{"read from socket"}
	ErrWriteToSocket       = &SConnError{"write to socket"}
	ErrReadHeaderBlock     = &SConnError{"read header block"}
	ErrInvalidMsgSize      = &SConnError{"invalid msgSize"}
	ErrReadHeaderBytes     = &SConnError{"read header bytes"}
	ErrReadBodyBytes       = &SConnError{"read body bytes"}
	ErrInvalidMessageBytes = &SConnError{"invalid message bytes"}
	ErrSendPayloadBytes    = &SConnError{"send payload bytes"}
	ErrCreateConnection    = &SConnError{"create connection"}
)

Functions

This section is empty.

Types

type IConn

type IConn interface {
	types.ICloser

	GetSettings() ISettings
	GetSocket() net.Conn

	GetVSettings() IVSettings
	SetVSettings(IVSettings)

	WriteMessage(context.Context, net_message.IMessage) error
	ReadMessage(context.Context, chan<- struct{}) (net_message.IMessage, error)
}

func LoadConn

func LoadConn(pSett ISettings, pVSett IVSettings, pConn net.Conn) IConn

func NewConn

func NewConn(pSett ISettings, pVSett IVSettings, pAddr string) (IConn, error)

type ISettings

type ISettings interface {
	GetLimitMessageSizeBytes() uint64
	GetLimitVoidSizeBytes() uint64
	GetWorkSizeBits() uint64

	GetDialTimeout() time.Duration
	GetReadTimeout() time.Duration
	GetWriteTimeout() time.Duration
	GetWaitReadTimeout() time.Duration
}

func NewSettings

func NewSettings(pSett *SSettings) ISettings

type IVSettings added in v1.6.7

type IVSettings interface {
	GetNetworkKey() string
}

func NewVSettings added in v1.6.7

func NewVSettings(pVSett *SVSettings) IVSettings

type SConnError added in v1.6.8

type SConnError struct {
	// contains filtered or unexported fields
}

func (*SConnError) Error added in v1.6.8

func (err *SConnError) Error() string

type SSettings

type SSettings sSettings

type SVSettings added in v1.6.7

type SVSettings sVSettings

Jump to

Keyboard shortcuts

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