storage

package
v1.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package storage contains an interface for reading and writing files in a torrent.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File interface {
	io.ReaderAt
	io.WriterAt
	io.Closer
}

File interface for reading/writing torrent data.

func NewPaddingFile added in v1.12.1

func NewPaddingFile(length int64) File

type PaddingFile added in v1.12.1

type PaddingFile struct{}

func (PaddingFile) Close added in v1.12.1

func (f PaddingFile) Close() error

func (PaddingFile) ReadAt added in v1.12.1

func (f PaddingFile) ReadAt(p []byte, off int64) (n int, err error)

func (PaddingFile) WriteAt added in v1.12.1

func (f PaddingFile) WriteAt(p []byte, off int64) (n int, err error)

type Storage

type Storage interface {
	Open(name string, size int64) (f File, exists bool, err error)
	RootDir() string
}

Storage is an interface for reading/writing torrent files.

Directories

Path Synopsis
Package filestorage implements Storage interface that uses files on disk as storage.
Package filestorage implements Storage interface that uses files on disk as storage.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL