emule

package
v0.0.0-...-55c090a Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: GPL-3.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const (
	C_NONE constrainttype = iota
	C_MAIN
	C_AND
	C_OR
	C_NOT
	C_CODEC
	C_MINSIZE
	C_MAXSIZE
	C_FILETYPE
	C_FILEEXT
	C_AVAIL
)

Variables

This section is empty.

Functions

func ByteToFloat32

func ByteToFloat32(data []byte) (ret float32)

func ByteToInt16

func ByteToInt16(data []byte) (ret int16)

func ByteToInt32

func ByteToInt32(data []byte) (ret int32)

func ByteToUint16

func ByteToUint16(data []byte) (ret uint16)

func ByteToUint32

func ByteToUint32(data []byte) (ret uint32)

func EncodeByteMsg

func EncodeByteMsg(protocol byte, msgcode byte, body []byte) []byte

func EncodeByteString

func EncodeByteString(str string) []byte

func EncodeByteTag

func EncodeByteTag(ttype byte, tagname []byte, tagvalue []byte) []byte

func EncodeByteTagInt

func EncodeByteTagInt(tagname []byte, tagvalue uint32) []byte

func EncodeByteTagName

func EncodeByteTagName(nbuf []byte) []byte

func EncodeByteTagNameInt

func EncodeByteTagNameInt(val byte) []byte

func EncodeByteTagNameStr

func EncodeByteTagNameStr(val string) []byte

func EncodeByteTagString

func EncodeByteTagString(tagname []byte, tagvalue string) []byte

func Float32ToByte

func Float32ToByte(data float32) (ret []byte)

func HighId

func HighId(addr string) (ret uint32)

func Int16ToByte

func Int16ToByte(data int16) (ret []byte)

func Int32ToByte

func Int32ToByte(data int32) (ret []byte)

func SliceBuf

func SliceBuf(buf []byte, from int, to int, newbuf *[]byte) bool

func StringToByte

func StringToByte(val string) []byte

func UInt16ToByte

func UInt16ToByte(data uint16) (ret []byte)

func UInt32ToByte

func UInt32ToByte(data uint32) (ret []byte)

Types

type Constraint

type Constraint struct {
	Type  constrainttype
	Value []byte
	Left  *Constraint
	Right *Constraint
}

type OneTag

type OneTag struct {
	Type       byte
	NameByte   byte
	NameString string
	Value      []byte
	ValueLen   uint16
}

TODO: check buf len on all and prevent read > len(buf)

func ReadTag

func ReadTag(pos int, buf []byte, debug bool) (bread int, ret *OneTag)

func ReadTags

func ReadTags(pos int, buf []byte, tags int, debug bool) (totalread int, ret []*OneTag)

type SockSrv

type SockSrv struct {
	Host               string
	Port               int
	Debug              bool
	Ssname             string
	Ssdesc             string
	Ssmsg              string
	I2P                bool
	SAM                string
	SAMPort            int
	SupportGzip        bool
	SupportNewTags     bool
	SupportUnicode     bool
	SupportRelSearch   bool
	SupportTTagInteger bool
	SupportLargeFiles  bool
	SupportObfuscation bool
	SQL                bool
	SqlDriver          string
	SqlUser            string
	SqlPW              string
	SqlAddr            string
	SqlPort            int
	SqlDB              string
	// contains filtered or unexported fields
}

func NewSockSrv

func NewSockSrv(host string, port int, debug bool) *SockSrv

func (*SockSrv) Start

func (this *SockSrv) Start()

func (*SockSrv) Stop

func (this *SockSrv) Stop()

type SockSrvClient

type SockSrvClient struct {
	Conn   net.Conn
	Comp   libdeflate.Compressor
	DeComp libdeflate.Decompressor
}

Jump to

Keyboard shortcuts

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