Documentation ¶
Overview ¶
Package testutil contains stuff for testing torrent-related behaviour.
"greeting" is a single-file torrent of a file called "greeting" that "contains "hello, world\n".
Index ¶
- Constants
- Variables
- func Autodir(t tt) string
- func CreateDummyTorrentData(dirName string) string
- func ExportStatusWriter(sw StatusWriter, path string) (release func())
- func GreetingMetaInfo() *metainfo.MetaInfo
- func GreetingTestTorrent() (tempDir string, metaInfo *metainfo.MetaInfo)
- func NewBadStorage() storage.ClientImpl
- func RandomDataTorrent(dir string, n int64) (d *os.File, err error)
- type File
- type StatusWriter
- type Torrent
Constants ¶
View Source
const ( GreetingFileContents = "hello, world\n" GreetingFileName = "greeting" )
various constants.
Variables ¶
View Source
var Greeting = Torrent{ Files: []File{{ Data: GreetingFileContents, }}, Name: GreetingFileName, }
Greeting torrent
Functions ¶
func Autodir ¶
func Autodir(t tt) string
Autodir generates random directory under the testing temp dir.
func CreateDummyTorrentData ¶
CreateDummyTorrentData in the given directory.
func ExportStatusWriter ¶
func ExportStatusWriter(sw StatusWriter, path string) (release func())
func GreetingTestTorrent ¶
GreetingTestTorrent a temporary directory containing the completed "greeting" torrent, and a corresponding metainfo describing it. The temporary directory can be cleaned away with os.RemoveAll.
Types ¶
type StatusWriter ¶
Click to show internal directories.
Click to hide internal directories.