Documentation
¶
Index ¶
- func ParseADNLAddress(addr string) ([]byte, error)
- type ADNL
- type Capabilities
- type DHT
- type GetCapabilities
- type GetNextPayloadPart
- type Header
- type PayloadPart
- type RLDP
- type Request
- type Resolver
- type Response
- type Transport
- type VirtualStorage
- func (v *VirtualStorage) GetActiveFiles(bagId []byte) ([]uint32, error)
- func (v *VirtualStorage) GetAll() []*storage.Torrent
- func (v *VirtualStorage) GetFS() storage.FS
- func (v *VirtualStorage) GetForcedPieceSize() uint32
- func (v *VirtualStorage) GetPiece(bagId []byte, id uint32) (*storage.PieceInfo, error)
- func (v *VirtualStorage) GetTorrentByOverlay(overlay []byte) *storage.Torrent
- func (v *VirtualStorage) PiecesMask(bagId []byte, num uint32) []byte
- func (v *VirtualStorage) RemovePiece(bagId []byte, id uint32) error
- func (v *VirtualStorage) SetActiveFiles(bagId []byte, ids []uint32) error
- func (v *VirtualStorage) SetPiece(bagId []byte, id uint32, p *storage.PieceInfo) error
- func (v *VirtualStorage) SetTorrent(t *storage.Torrent) error
- func (v *VirtualStorage) UpdateUploadStats(bagId []byte, val uint64) error
- func (v *VirtualStorage) VerifyOnStartup() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseADNLAddress ¶ added in v1.6.0
Types ¶
type ADNL ¶
type ADNL interface {
RemoteAddr() string
GetID() []byte
Query(ctx context.Context, req, result tl.Serializable) error
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
GetCloserCtx() context.Context
Close()
}
type Capabilities ¶ added in v1.6.0
type Capabilities struct {
Value int64 `tl:"long"`
}
type GetCapabilities ¶ added in v1.6.0
type GetCapabilities struct {
Capabilities int64 `tl:"long"`
}
type GetNextPayloadPart ¶ added in v1.6.0
type PayloadPart ¶ added in v1.6.0
type RLDP ¶
type RLDP interface {
Close()
DoQuery(ctx context.Context, maxAnswerSize uint64, query, result tl.Serializable) error
SetOnQuery(handler func(transferId []byte, query *rldp.Query) error)
SetOnDisconnect(handler func())
SendAnswer(ctx context.Context, maxAnswerSize uint64, timeoutAt uint32, queryId, transferId []byte, answer tl.Serializable) error
GetADNL() rldp.ADNL
}
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
func NewTransport ¶
func NewTransport(gate *adnl.Gateway, dht DHT, resolver Resolver, storeConn storage.NetConnector, store *VirtualStorage) *Transport
type VirtualStorage ¶
type VirtualStorage struct {
// contains filtered or unexported fields
}
func NewVirtualStorage ¶
func NewVirtualStorage() *VirtualStorage
func (*VirtualStorage) GetActiveFiles ¶
func (v *VirtualStorage) GetActiveFiles(bagId []byte) ([]uint32, error)
func (*VirtualStorage) GetAll ¶
func (v *VirtualStorage) GetAll() []*storage.Torrent
func (*VirtualStorage) GetFS ¶
func (v *VirtualStorage) GetFS() storage.FS
func (*VirtualStorage) GetForcedPieceSize ¶ added in v1.7.0
func (v *VirtualStorage) GetForcedPieceSize() uint32
func (*VirtualStorage) GetTorrentByOverlay ¶
func (v *VirtualStorage) GetTorrentByOverlay(overlay []byte) *storage.Torrent
func (*VirtualStorage) PiecesMask ¶
func (v *VirtualStorage) PiecesMask(bagId []byte, num uint32) []byte
func (*VirtualStorage) RemovePiece ¶
func (v *VirtualStorage) RemovePiece(bagId []byte, id uint32) error
func (*VirtualStorage) SetActiveFiles ¶
func (v *VirtualStorage) SetActiveFiles(bagId []byte, ids []uint32) error
func (*VirtualStorage) SetTorrent ¶
func (v *VirtualStorage) SetTorrent(t *storage.Torrent) error
func (*VirtualStorage) UpdateUploadStats ¶ added in v1.5.0
func (v *VirtualStorage) UpdateUploadStats(bagId []byte, val uint64) error
func (*VirtualStorage) VerifyOnStartup ¶ added in v1.7.0
func (v *VirtualStorage) VerifyOnStartup() bool
Click to show internal directories.
Click to hide internal directories.