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) GetDisconnectHandler() func(addr string, key ed25519.PublicKey)
- 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 ¶ added in v1.7.1
func UnwrapMessage(data tl.Serializable) (tl.Serializable, []byte)
func UnwrapQuery ¶ added in v1.7.1
func UnwrapQuery(data tl.Serializable) (tl.Serializable, []byte)
func WrapMessage ¶ added in v1.7.1
func WrapMessage(id []byte, data tl.Serializable) tl.Serializable
func WrapQuery ¶ added in v1.7.1
func WrapQuery(id []byte, data tl.Serializable) tl.Serializable
Types ¶
type ADNL ¶ added in v1.6.0
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)) GetDisconnectHandler() 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 ¶ added in v1.6.0
type ADNLOverlayWrapper struct { *ADNLWrapper // contains filtered or unexported fields }
func (*ADNLOverlayWrapper) Close ¶ added in v1.6.0
func (a *ADNLOverlayWrapper) Close()
func (*ADNLOverlayWrapper) GetRandomPeers ¶ added in v1.6.0
func (a *ADNLOverlayWrapper) GetRandomPeers(ctx context.Context) ([]Node, error)
func (*ADNLOverlayWrapper) Query ¶ added in v1.6.0
func (a *ADNLOverlayWrapper) Query(ctx context.Context, req, result tl.Serializable) error
func (*ADNLOverlayWrapper) SendCustomMessage ¶ added in v1.6.0
func (a *ADNLOverlayWrapper) SendCustomMessage(ctx context.Context, req tl.Serializable) error
func (*ADNLOverlayWrapper) SetAuthorizedKeys ¶ added in v1.6.0
func (a *ADNLOverlayWrapper) SetAuthorizedKeys(keysWithMaxLen map[string]int32)
func (*ADNLOverlayWrapper) SetBroadcastHandler ¶ added in v1.6.0
func (a *ADNLOverlayWrapper) SetBroadcastHandler(handler func(msg tl.Serializable, trusted bool) error)
func (*ADNLOverlayWrapper) SetCustomMessageHandler ¶ added in v1.6.0
func (a *ADNLOverlayWrapper) SetCustomMessageHandler(handler func(msg *adnl.MessageCustom) error)
func (*ADNLOverlayWrapper) SetDisconnectHandler ¶ added in v1.6.0
func (a *ADNLOverlayWrapper) SetDisconnectHandler(handler func(addr string, key ed25519.PublicKey))
func (*ADNLOverlayWrapper) SetQueryHandler ¶ added in v1.6.0
func (a *ADNLOverlayWrapper) SetQueryHandler(handler func(msg *adnl.MessageQuery) error)
type ADNLWrapper ¶ added in v1.6.0
type ADNLWrapper struct { ADNL // contains filtered or unexported fields }
func CreateExtendedADNL ¶ added in v1.6.0
func CreateExtendedADNL(adnl ADNL) *ADNLWrapper
func (*ADNLWrapper) CreateOverlayWithSettings ¶ added in v1.6.0
func (a *ADNLWrapper) CreateOverlayWithSettings(id []byte, maxUnauthBroadcastSize int32, allowBroadcastFEC bool, trustUnauthorizedBroadcast bool) *ADNLOverlayWrapper
func (*ADNLWrapper) GetDisconnectHandler ¶ added in v1.9.3
func (a *ADNLWrapper) GetDisconnectHandler() func(addr string, key ed25519.PublicKey)
func (*ADNLWrapper) SetCustomMessageHandler ¶ added in v1.6.0
func (a *ADNLWrapper) SetCustomMessageHandler(handler func(msg *adnl.MessageCustom) error)
func (*ADNLWrapper) SetDisconnectHandler ¶ added in v1.6.0
func (a *ADNLWrapper) SetDisconnectHandler(handler func(addr string, key ed25519.PublicKey))
func (*ADNLWrapper) SetOnUnknownOverlayQuery ¶ added in v1.7.1
func (a *ADNLWrapper) SetOnUnknownOverlayQuery(handler func(query *adnl.MessageQuery) error)
func (*ADNLWrapper) SetQueryHandler ¶ added in v1.6.0
func (a *ADNLWrapper) SetQueryHandler(handler func(msg *adnl.MessageQuery) error)
func (*ADNLWrapper) UnregisterOverlay ¶ added in v1.6.0
func (a *ADNLWrapper) UnregisterOverlay(id []byte)
func (*ADNLWrapper) WithOverlay ¶ added in v1.6.0
func (a *ADNLWrapper) WithOverlay(id []byte) *ADNLOverlayWrapper
WithOverlay - creates basic overlay with restrictive broadcast settings
type BroadcastFEC ¶ added in v1.6.0
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 ¶ added in v1.6.0
func (t *BroadcastFEC) CalcID() ([]byte, error)
type BroadcastFECID ¶ added in v1.6.0
type BroadcastFECPartID ¶ added in v1.6.0
type BroadcastFECShort ¶ added in v1.6.0
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 ¶ added in v1.6.0
type CertCheckResult ¶ added in v1.6.0
type CertCheckResult int
const CertCheckResultForbidden CertCheckResult = 0
const CertCheckResultNeedCheck CertCheckResult = 2
const CertCheckResultTrusted CertCheckResult = 1
type Certificate ¶ added in v1.6.0
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 ¶ added in v1.6.0
func (c Certificate) Check(issuedToId []byte, overlayId []byte, dataSize int32, isFEC bool) (CertCheckResult, error)
type CertificateEmpty ¶ added in v1.6.0
type CertificateEmpty struct{}
type CertificateId ¶ added in v1.6.0
type CertificateIdV2 ¶ added in v1.6.0
type CertificateV2 ¶ added in v1.6.0
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 ¶ added in v1.6.0
func (c CertificateV2) Check(issuedToId []byte, overlayId []byte, dataSize int32, isFEC bool) (CertCheckResult, error)
type CheckableCert ¶ added in v1.6.0
type FECCompleted ¶ added in v1.6.0
type FECCompleted struct {
Hash []byte `tl:"int256"`
}
type FECReceived ¶ added in v1.6.0
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 ¶ added in v1.6.0
type NodeToSign ¶ added in v1.6.0
type RLDP ¶ added in v1.6.0
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 ¶ added in v1.6.0
type RLDPOverlayWrapper struct { *RLDPWrapper // contains filtered or unexported fields }
func (*RLDPOverlayWrapper) Close ¶ added in v1.6.0
func (r *RLDPOverlayWrapper) Close()
func (*RLDPOverlayWrapper) DoQuery ¶ added in v1.6.0
func (r *RLDPOverlayWrapper) DoQuery(ctx context.Context, maxAnswerSize int64, req, result tl.Serializable) error
func (*RLDPOverlayWrapper) SetOnDisconnect ¶ added in v1.6.0
func (r *RLDPOverlayWrapper) SetOnDisconnect(handler func())
func (*RLDPOverlayWrapper) SetOnQuery ¶ added in v1.6.0
func (r *RLDPOverlayWrapper) SetOnQuery(handler func(transferId []byte, query *rldp.Query) error)
type RLDPWrapper ¶ added in v1.6.0
type RLDPWrapper struct { RLDP // contains filtered or unexported fields }
func CreateExtendedRLDP ¶ added in v1.6.0
func CreateExtendedRLDP(rldp RLDP) *RLDPWrapper
func (*RLDPWrapper) CreateOverlay ¶ added in v1.6.0
func (r *RLDPWrapper) CreateOverlay(id []byte) *RLDPOverlayWrapper
func (*RLDPWrapper) SetOnDisconnect ¶ added in v1.6.0
func (r *RLDPWrapper) SetOnDisconnect(handler func())
func (*RLDPWrapper) SetOnQuery ¶ added in v1.6.0
func (r *RLDPWrapper) SetOnQuery(handler func(transferId []byte, query *rldp.Query) error)
func (*RLDPWrapper) SetOnUnknownOverlayQuery ¶ added in v1.7.1
func (r *RLDPWrapper) SetOnUnknownOverlayQuery(handler func(transferId []byte, query *rldp.Query) error)
func (*RLDPWrapper) UnregisterOverlay ¶ added in v1.6.0
func (r *RLDPWrapper) UnregisterOverlay(id []byte)
Click to show internal directories.
Click to hide internal directories.