Documentation ¶
Index ¶
- Constants
- Variables
- func ParseADNLAddress(addr string) ([]byte, error)
- func SerializeADNLAddress(addr []byte) (string, error)
- type ADNL
- type ADNLGateway
- type Capabilities
- type DHT
- type GetCapabilities
- type GetNextPayloadPart
- type Header
- type PayloadPart
- type RLDP
- type Request
- type Resolver
- type Response
- type Server
- type Transport
Constants ¶
View Source
const CapabilityRLDP2 int64 = 1
Variables ¶
View Source
var Connector = func(ctx context.Context, addr string, peerKey ed25519.PublicKey, ourKey ed25519.PrivateKey) (ADNL, error) { return adnl.Connect(ctx, addr, peerKey, ourKey) }
View Source
var ErrSiteUsesStorage = fmt.Errorf("requested site is static and uses ton storage, you can files using storage.Downloader")
View Source
var Logger = log.Println
Functions ¶
func ParseADNLAddress ¶
func SerializeADNLAddress ¶
Types ¶
type ADNL ¶
type ADNL interface { GetID() []byte RemoteAddr() string Query(ctx context.Context, req, result tl.Serializable) error SetDisconnectHandler(handler func(addr string, key ed25519.PublicKey)) GetDisconnectHandler() func(addr string, key ed25519.PublicKey) SetCustomMessageHandler(handler func(msg *adnl.MessageCustom) error) SendCustomMessage(ctx context.Context, req tl.Serializable) error SetQueryHandler(handler func(msg *adnl.MessageQuery) error) GetQueryHandler() func(msg *adnl.MessageQuery) error Answer(ctx context.Context, queryID []byte, result tl.Serializable) error Close() }
type ADNLGateway ¶ added in v1.6.0
type Capabilities ¶ added in v1.7.0
type Capabilities struct {
Value int64 `tl:"long"`
}
type GetCapabilities ¶ added in v1.7.0
type GetCapabilities struct {
Capabilities int64 `tl:"long"`
}
type GetNextPayloadPart ¶
type PayloadPart ¶
type RLDP ¶
type RLDP interface { 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 Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
func NewTransport ¶
func NewTransport(dht DHT, resolver Resolver, adnlKey ...ed25519.PrivateKey) *Transport
Click to show internal directories.
Click to hide internal directories.