Documentation ¶
Index ¶
- func UnwrapMessage(data tl.Serializable) (tl.Serializable, []byte)
- func UnwrapQuery(data tl.Serializable) (tl.Serializable, []byte)
- func WrapMessage(id []byte, data tl.Serializable) tl.Serializable
- func WrapQuery(id []byte, data tl.Serializable) tl.Serializable
- type ADNL
- type ADNLOverlayWrapper
- func (a *ADNLOverlayWrapper) Close()
- func (a *ADNLOverlayWrapper) GetRandomPeers(ctx context.Context) ([]Node, error)
- func (a *ADNLOverlayWrapper) Query(ctx context.Context, req, result tl.Serializable) error
- func (a *ADNLOverlayWrapper) SendCustomMessage(ctx context.Context, req tl.Serializable) error
- func (a *ADNLOverlayWrapper) SetAuthorizedKeys(keysWithMaxLen map[string]int32)
- func (a *ADNLOverlayWrapper) SetBroadcastHandler(handler func(msg tl.Serializable, trusted bool) error)
- func (a *ADNLOverlayWrapper) SetCustomMessageHandler(handler func(msg *adnl.MessageCustom) error)
- func (a *ADNLOverlayWrapper) SetDisconnectHandler(handler func(addr string, key ed25519.PublicKey))
- func (a *ADNLOverlayWrapper) SetQueryHandler(handler func(msg *adnl.MessageQuery) error)
- type ADNLWrapper
- func (a *ADNLWrapper) CreateOverlayWithSettings(id []byte, maxUnauthBroadcastSize int32, allowBroadcastFEC bool, ...) *ADNLOverlayWrapper
- func (a *ADNLWrapper) SetCustomMessageHandler(handler func(msg *adnl.MessageCustom) error)
- func (a *ADNLWrapper) SetDisconnectHandler(handler func(addr string, key ed25519.PublicKey))
- func (a *ADNLWrapper) SetOnUnknownOverlayQuery(handler func(query *adnl.MessageQuery) error)
- func (a *ADNLWrapper) SetQueryHandler(handler func(msg *adnl.MessageQuery) error)
- func (a *ADNLWrapper) UnregisterOverlay(id []byte)
- func (a *ADNLWrapper) WithOverlay(id []byte) *ADNLOverlayWrapper
- type Broadcast
- type BroadcastFEC
- type BroadcastFECID
- type BroadcastFECPartID
- type BroadcastFECShort
- type BroadcastToSign
- type CertCheckResult
- type Certificate
- type CertificateEmpty
- type CertificateId
- type CertificateIdV2
- type CertificateV2
- type CheckableCert
- type FECCompleted
- type FECReceived
- type GetRandomPeers
- type Message
- type Node
- type NodeToSign
- type NodesList
- type Query
- type RLDP
- type RLDPOverlayWrapper
- func (r *RLDPOverlayWrapper) Close()
- func (r *RLDPOverlayWrapper) DoQuery(ctx context.Context, maxAnswerSize int64, req, result tl.Serializable) error
- func (r *RLDPOverlayWrapper) SetOnDisconnect(handler func())
- func (r *RLDPOverlayWrapper) SetOnQuery(handler func(transferId []byte, query *rldp.Query) error)
- type RLDPWrapper
- func (r *RLDPWrapper) CreateOverlay(id []byte) *RLDPOverlayWrapper
- func (r *RLDPWrapper) SetOnDisconnect(handler func())
- func (r *RLDPWrapper) SetOnQuery(handler func(transferId []byte, query *rldp.Query) error)
- func (r *RLDPWrapper) SetOnUnknownOverlayQuery(handler func(transferId []byte, query *rldp.Query) error)
- func (r *RLDPWrapper) UnregisterOverlay(id []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnwrapMessage ¶
func UnwrapMessage(data tl.Serializable) (tl.Serializable, []byte)
func UnwrapQuery ¶
func UnwrapQuery(data tl.Serializable) (tl.Serializable, []byte)
func WrapMessage ¶
func WrapMessage(id []byte, data tl.Serializable) tl.Serializable
func WrapQuery ¶
func WrapQuery(id []byte, data tl.Serializable) tl.Serializable
Types ¶
type ADNL ¶
type ADNL interface { SetCustomMessageHandler(handler func(msg *adnl.MessageCustom) error) SetQueryHandler(handler func(msg *adnl.MessageQuery) error) SetDisconnectHandler(handler func(addr string, key ed25519.PublicKey)) SendCustomMessage(ctx context.Context, req tl.Serializable) error Query(ctx context.Context, req, result tl.Serializable) error Answer(ctx context.Context, queryID []byte, result tl.Serializable) error RemoteAddr() string GetID() []byte Close() }
type ADNLOverlayWrapper ¶
type ADNLOverlayWrapper struct { *ADNLWrapper // contains filtered or unexported fields }
func (*ADNLOverlayWrapper) Close ¶
func (a *ADNLOverlayWrapper) Close()
func (*ADNLOverlayWrapper) GetRandomPeers ¶
func (a *ADNLOverlayWrapper) GetRandomPeers(ctx context.Context) ([]Node, error)
func (*ADNLOverlayWrapper) Query ¶
func (a *ADNLOverlayWrapper) Query(ctx context.Context, req, result tl.Serializable) error
func (*ADNLOverlayWrapper) SendCustomMessage ¶
func (a *ADNLOverlayWrapper) SendCustomMessage(ctx context.Context, req tl.Serializable) error
func (*ADNLOverlayWrapper) SetAuthorizedKeys ¶
func (a *ADNLOverlayWrapper) SetAuthorizedKeys(keysWithMaxLen map[string]int32)
func (*ADNLOverlayWrapper) SetBroadcastHandler ¶
func (a *ADNLOverlayWrapper) SetBroadcastHandler(handler func(msg tl.Serializable, trusted bool) error)
func (*ADNLOverlayWrapper) SetCustomMessageHandler ¶
func (a *ADNLOverlayWrapper) SetCustomMessageHandler(handler func(msg *adnl.MessageCustom) error)
func (*ADNLOverlayWrapper) SetDisconnectHandler ¶
func (a *ADNLOverlayWrapper) SetDisconnectHandler(handler func(addr string, key ed25519.PublicKey))
func (*ADNLOverlayWrapper) SetQueryHandler ¶
func (a *ADNLOverlayWrapper) SetQueryHandler(handler func(msg *adnl.MessageQuery) error)
type ADNLWrapper ¶
type ADNLWrapper struct { ADNL // contains filtered or unexported fields }
func CreateExtendedADNL ¶
func CreateExtendedADNL(adnl ADNL) *ADNLWrapper
func (*ADNLWrapper) CreateOverlayWithSettings ¶
func (a *ADNLWrapper) CreateOverlayWithSettings(id []byte, maxUnauthBroadcastSize int32, allowBroadcastFEC bool, trustUnauthorizedBroadcast bool) *ADNLOverlayWrapper
func (*ADNLWrapper) SetCustomMessageHandler ¶
func (a *ADNLWrapper) SetCustomMessageHandler(handler func(msg *adnl.MessageCustom) error)
func (*ADNLWrapper) SetDisconnectHandler ¶
func (a *ADNLWrapper) SetDisconnectHandler(handler func(addr string, key ed25519.PublicKey))
func (*ADNLWrapper) SetOnUnknownOverlayQuery ¶
func (a *ADNLWrapper) SetOnUnknownOverlayQuery(handler func(query *adnl.MessageQuery) error)
func (*ADNLWrapper) SetQueryHandler ¶
func (a *ADNLWrapper) SetQueryHandler(handler func(msg *adnl.MessageQuery) error)
func (*ADNLWrapper) UnregisterOverlay ¶
func (a *ADNLWrapper) UnregisterOverlay(id []byte)
func (*ADNLWrapper) WithOverlay ¶
func (a *ADNLWrapper) WithOverlay(id []byte) *ADNLOverlayWrapper
WithOverlay - creates basic overlay with restrictive broadcast settings
type BroadcastFEC ¶
type BroadcastFEC struct { Source any `tl:"struct boxed [pub.ed25519]"` Certificate any `tl:"struct boxed [overlay.emptyCertificate,overlay.certificate,overlay.certificateV2]"` DataHash []byte `tl:"int256"` DataSize int32 `tl:"int"` Flags int32 `tl:"int"` Data []byte `tl:"bytes"` Seqno int32 `tl:"int"` FEC any `tl:"struct boxed [fec.roundRobin,fec.raptorQ,fec.online]"` Date int32 `tl:"int"` Signature []byte `tl:"bytes"` }
func (*BroadcastFEC) CalcID ¶
func (t *BroadcastFEC) CalcID() ([]byte, error)
type BroadcastFECID ¶
type BroadcastFECPartID ¶
type BroadcastFECShort ¶
type BroadcastFECShort struct { Source any `tl:"struct boxed [pub.ed25519]"` Certificate any `tl:"struct boxed [overlay.emptyCertificate,overlay.certificate,overlay.certificateV2]"` BroadcastHash []byte `tl:"int256"` PartDataHash []byte `tl:"int256"` Seqno int32 `tl:"int"` Signature []byte `tl:"bytes"` }
type BroadcastToSign ¶
type CertCheckResult ¶
type CertCheckResult int
const CertCheckResultForbidden CertCheckResult = 0
const CertCheckResultNeedCheck CertCheckResult = 2
const CertCheckResultTrusted CertCheckResult = 1
type Certificate ¶
type Certificate struct { IssuedBy any `tl:"struct boxed [pub.ed25519]"` ExpireAt int32 `tl:"int"` MaxSize int32 `tl:"int"` Signature []byte `tl:"bytes"` }
func (Certificate) Check ¶
func (c Certificate) Check(issuedToId []byte, overlayId []byte, dataSize int32, isFEC bool) (CertCheckResult, error)
type CertificateEmpty ¶
type CertificateEmpty struct{}
type CertificateId ¶
type CertificateIdV2 ¶
type CertificateV2 ¶
type CertificateV2 struct { IssuedBy any `tl:"struct boxed [pub.ed25519]"` ExpireAt int32 `tl:"int"` MaxSize int32 `tl:"int"` Flags int32 `tl:"int"` Signature []byte `tl:"bytes"` }
func (CertificateV2) Check ¶
func (c CertificateV2) Check(issuedToId []byte, overlayId []byte, dataSize int32, isFEC bool) (CertCheckResult, error)
type CheckableCert ¶
type FECCompleted ¶
type FECCompleted struct {
Hash []byte `tl:"int256"`
}
type FECReceived ¶
type FECReceived struct {
Hash []byte `tl:"int256"`
}
type GetRandomPeers ¶
type GetRandomPeers struct {
List NodesList `tl:"struct"`
}
type Node ¶
type Node struct { ID any `tl:"struct boxed [pub.ed25519,pub.aes]"` Overlay []byte `tl:"int256"` Version int32 `tl:"int"` Signature []byte `tl:"bytes"` }
func (*Node) CheckSignature ¶
type NodeToSign ¶
type RLDP ¶
type RLDP interface { GetADNL() rldp.ADNL Close() DoQuery(ctx context.Context, maxAnswerSize int64, query, result tl.Serializable) error SetOnQuery(handler func(transferId []byte, query *rldp.Query) error) SetOnDisconnect(handler func()) SendAnswer(ctx context.Context, maxAnswerSize int64, queryId, transferId []byte, answer tl.Serializable) error }
type RLDPOverlayWrapper ¶
type RLDPOverlayWrapper struct { *RLDPWrapper // contains filtered or unexported fields }
func (*RLDPOverlayWrapper) Close ¶
func (r *RLDPOverlayWrapper) Close()
func (*RLDPOverlayWrapper) DoQuery ¶
func (r *RLDPOverlayWrapper) DoQuery(ctx context.Context, maxAnswerSize int64, req, result tl.Serializable) error
func (*RLDPOverlayWrapper) SetOnDisconnect ¶
func (r *RLDPOverlayWrapper) SetOnDisconnect(handler func())
func (*RLDPOverlayWrapper) SetOnQuery ¶
func (r *RLDPOverlayWrapper) SetOnQuery(handler func(transferId []byte, query *rldp.Query) error)
type RLDPWrapper ¶
type RLDPWrapper struct { RLDP // contains filtered or unexported fields }
func CreateExtendedRLDP ¶
func CreateExtendedRLDP(rldp RLDP) *RLDPWrapper
func (*RLDPWrapper) CreateOverlay ¶
func (r *RLDPWrapper) CreateOverlay(id []byte) *RLDPOverlayWrapper
func (*RLDPWrapper) SetOnDisconnect ¶
func (r *RLDPWrapper) SetOnDisconnect(handler func())
func (*RLDPWrapper) SetOnQuery ¶
func (r *RLDPWrapper) SetOnQuery(handler func(transferId []byte, query *rldp.Query) error)
func (*RLDPWrapper) SetOnUnknownOverlayQuery ¶
func (r *RLDPWrapper) SetOnUnknownOverlayQuery(handler func(transferId []byte, query *rldp.Query) error)
func (*RLDPWrapper) UnregisterOverlay ¶
func (r *RLDPWrapper) UnregisterOverlay(id []byte)
Click to show internal directories.
Click to hide internal directories.