Improve some docs
This commit is contained in:
parent
93f914a6d3
commit
61acdf6184
7
t.go
7
t.go
|
@ -12,9 +12,8 @@ func (t *Torrent) InfoHash() metainfo.Hash {
|
||||||
return t.infoHash
|
return t.infoHash
|
||||||
}
|
}
|
||||||
|
|
||||||
// Closed when the info (.Info()) for the torrent has become available. Using
|
// Returns a channel that is closed when the info (.Info()) for the torrent
|
||||||
// features of Torrent that require the info before it is available will have
|
// has become available.
|
||||||
// undefined behaviour.
|
|
||||||
func (t *Torrent) GotInfo() <-chan struct{} {
|
func (t *Torrent) GotInfo() <-chan struct{} {
|
||||||
return t.gotMetainfo
|
return t.gotMetainfo
|
||||||
}
|
}
|
||||||
|
@ -102,6 +101,8 @@ func (t *Torrent) Name() string {
|
||||||
return t.name()
|
return t.name()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The completed length of all the torrent data, in all its files. This is
|
||||||
|
// derived from the torrent info, when it is available.
|
||||||
func (t *Torrent) Length() int64 {
|
func (t *Torrent) Length() int64 {
|
||||||
select {
|
select {
|
||||||
case <-t.GotInfo():
|
case <-t.GotInfo():
|
||||||
|
|
Loading…
Reference in New Issue