rldp

package
v1.9.5 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 12 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger = func(a ...any) {}

Functions

This section is empty.

Types

type ADNL

type ADNL interface {
	RemoteAddr() string
	GetID() []byte
	SetCustomMessageHandler(handler func(msg *adnl.MessageCustom) error)
	SetDisconnectHandler(handler func(addr string, key ed25519.PublicKey))
	GetDisconnectHandler() func(addr string, key ed25519.PublicKey)
	SendCustomMessage(ctx context.Context, req tl.Serializable) error
	Close()
}

type Answer

type Answer struct {
	ID   []byte `tl:"int256"`
	Data any    `tl:"bytes struct boxed"`
}

type Complete

type Complete struct {
	TransferID []byte `tl:"int256"`
	Part       int32  `tl:"int"`
}

type CompleteV2 added in v1.6.0

type CompleteV2 struct {
	TransferID []byte `tl:"int256"`
	Part       int32  `tl:"int"`
}

type Confirm

type Confirm struct {
	TransferID []byte `tl:"int256"`
	Part       int32  `tl:"int"`
	Seqno      int32  `tl:"int"`
}

type ConfirmV2 added in v1.6.0

type ConfirmV2 struct {
	TransferID    []byte `tl:"int256"`
	Part          int32  `tl:"int"`
	MaxSeqno      int32  `tl:"int"`
	ReceivedMask  int32  `tl:"int"`
	ReceivedCount int32  `tl:"int"`
}

type FECOnline

type FECOnline struct {
	DataSize     int32 `tl:"int"`
	SymbolSize   int32 `tl:"int"`
	SymbolsCount int32 `tl:"int"`
}

type FECRaptorQ

type FECRaptorQ struct {
	DataSize     int32 `tl:"int"`
	SymbolSize   int32 `tl:"int"`
	SymbolsCount int32 `tl:"int"`
}

type FECRoundRobin

type FECRoundRobin struct {
	DataSize     int32 `tl:"int"`
	SymbolSize   int32 `tl:"int"`
	SymbolsCount int32 `tl:"int"`
}

type Message

type Message struct {
	ID   []byte `tl:"int256"`
	Data []byte `tl:"bytes"`
}

type MessagePart

type MessagePart struct {
	TransferID []byte `tl:"int256"`
	FecType    any    `tl:"struct boxed [fec.roundRobin,fec.raptorQ,fec.online]"`
	Part       int32  `tl:"int"`
	TotalSize  int64  `tl:"long"`
	Seqno      int32  `tl:"int"`
	Data       []byte `tl:"bytes"`
}

type MessagePartV2 added in v1.6.0

type MessagePartV2 struct {
	TransferID []byte `tl:"int256"`
	FecType    any    `tl:"struct boxed [fec.roundRobin,fec.raptorQ,fec.online]"`
	Part       int32  `tl:"int"`
	TotalSize  int64  `tl:"long"`
	Seqno      int32  `tl:"int"`
	Data       []byte `tl:"bytes"`
}

type Query

type Query struct {
	ID            []byte `tl:"int256"`
	MaxAnswerSize int64  `tl:"long"`
	Timeout       int32  `tl:"int"`
	Data          any    `tl:"bytes struct boxed"`
}

type RLDP

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

func NewClient

func NewClient(a ADNL) *RLDP

func NewClientV2 added in v1.6.0

func NewClientV2(a ADNL) *RLDP

func (*RLDP) Close

func (r *RLDP) Close()

func (*RLDP) DoQuery

func (r *RLDP) DoQuery(ctx context.Context, maxAnswerSize int64, query, result tl.Serializable) error

func (*RLDP) GetADNL added in v1.8.0

func (r *RLDP) GetADNL() ADNL

func (*RLDP) SendAnswer

func (r *RLDP) SendAnswer(ctx context.Context, maxAnswerSize int64, queryId, toTransferId []byte, answer tl.Serializable) error

func (*RLDP) SetOnDisconnect deprecated

func (r *RLDP) SetOnDisconnect(handler func())

Deprecated: use GetADNL().SetDisconnectHandler WARNING: it overrides underlying adnl disconnect handler

func (*RLDP) SetOnQuery

func (r *RLDP) SetOnQuery(handler func(transferId []byte, query *Query) error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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