Documentation ¶
Index ¶
- Constants
- func DistributeByHash(dirs []string, hash string) (string, error)
- func GetDir(location string, hash string) (string, error)
- func NewMMap(baseDir string) *mmapClientImpl
- func NewThrottledReader(r io.ReadSeeker, b *ratelimit.Bucket) io.ReadSeeker
- func RegisterFileStoreFlags(f []cli.Flag) []cli.Flag
- func RegisterSnapshotFlags(f []cli.Flag) []cli.Flag
- func RegisterStatFlags(f []cli.Flag) []cli.Flag
- func RegisterTorrentClientFlags(f []cli.Flag) []cli.Flag
- func RegisterTorrentStoreFlags(f []cli.Flag) []cli.Flag
- func RegisterWebFlags(f []cli.Flag) []cli.Flag
- type BlockListener
- type BucketPool
- type CompletedPieces
- type FileMapping
- type FileStoreMap
- type PieceReader
- type Snapshot
- type SnapshotMap
- type SnapshotResponseWriter
- type Stat
- type StatGRPC
- type StatStreamServer
- func (s *StatStreamServer) Context() context.Context
- func (s *StatStreamServer) Ping()
- func (s *StatStreamServer) RecvMsg(m interface{}) error
- func (s *StatStreamServer) Send(m *pb.StatReply) error
- func (s *StatStreamServer) SendHeader(m metadata.MD) error
- func (s *StatStreamServer) SendMsg(m interface{}) error
- func (s *StatStreamServer) SetHeader(m metadata.MD) error
- func (s *StatStreamServer) SetTrailer(m metadata.MD)
- type StatWeb
- type ThrottledReader
- type TorrentClient
- type TorrentMap
- type TorrentStore
- type TorrentStoreMap
- type TouchMap
- type Web
- type WebSeeder
Constants ¶
View Source
const ( AWSBucketFlag = "aws-bucket" AWSBucketSpreadFlag = "aws-bucket-spread" AWSConcurrency = "aws-concurrency" AWSStatWriteDelayFlag = "aws-stat-write-delay" UseSnapshotFlag = "use-snapshot" SnapshotStartThresholdFlag = "snapshot-start-threshold" SnapshotDownloadRatioFlag = "snapshot-download-ratio" SnapshotWriteTimeoutFlag = "snapshot-write-timeout" SnapshotStartFullDownloadThresholdFlag = "snapshot-start-full-download-threshold" SnapshotTorrentSizeLimitFlag = "snapshot-torrent-size-limit" )
View Source
const ( DownloadedSizePath = "downloaded_size" TouchPath = "touch" CompletedPiecesPath = "completed_pieces" )
View Source
const ( StatHostFlag = "stat-host" StatPortFlag = "stat-port" )
View Source
const ( TorrentClientDownloadRateFlag = "download-rate" TorrentClientUserAgentFlag = "user-agent" HttpProxyFlag = "http-proxy" DisableUtpFlag = "disable-utp" DisableWebTorrentFlag = "disable-webtorrent" )
View Source
const ( TorrentStoreHostFlag = "torrent-store-host" TorrentStorePortFlag = "torrent-store-port" )
View Source
const ( WebHostFlag = "host" WebPortFlag = "port" )
View Source
const ( PiecePath = "piece/" SourceTorrentPath = "source.torrent" MaxReadahead = 250 * 1024 * 1024 MinReadahead = 1024 * 1024 )
View Source
const (
BucketTTL = 30 * 60
)
View Source
const (
DataDirFlag = "data-dir"
)
View Source
const (
InputFlag string = "input"
)
Variables ¶
This section is empty.
Functions ¶
func NewThrottledReader ¶
func NewThrottledReader(r io.ReadSeeker, b *ratelimit.Bucket) io.ReadSeeker
Types ¶
type BlockListener ¶
type BlockListener struct {
// contains filtered or unexported fields
}
func NewBlockListener ¶
func NewBlockListener(l net.Listener, blockedIP []net.IP) *BlockListener
func (*BlockListener) Addr ¶
func (ln *BlockListener) Addr() net.Addr
func (*BlockListener) Close ¶
func (ln *BlockListener) Close() error
type BucketPool ¶
type BucketPool struct {
// contains filtered or unexported fields
}
func NewBucketPool ¶
func NewBucketPool() *BucketPool
type CompletedPieces ¶
func (CompletedPieces) Add ¶
func (cp CompletedPieces) Add(p *torrent.Piece)
func (CompletedPieces) FromBytes ¶
func (cp CompletedPieces) FromBytes(data []byte)
func (CompletedPieces) Len ¶
func (cp CompletedPieces) Len() int
func (CompletedPieces) ToBytes ¶
func (cp CompletedPieces) ToBytes() []byte
type FileMapping ¶
func WrapFileMapping ¶
func WrapFileMapping(region mmap.MMap, file *os.File) FileMapping
Combines a mmapped region and file into a storage Mmap abstraction, which handles closing the mmap file handle.
type FileStoreMap ¶
type FileStoreMap struct {
// contains filtered or unexported fields
}
func NewFileStoreMap ¶
func NewFileStoreMap(c *cli.Context) *FileStoreMap
func (*FileStoreMap) List ¶
func (s *FileStoreMap) List() ([]string, error)
type PieceReader ¶
type PieceReader struct {
// contains filtered or unexported fields
}
func NewPieceReader ¶
func NewPieceReader(r torrent.Reader, p *torrent.Piece) *PieceReader
func (*PieceReader) Close ¶
func (s *PieceReader) Close() error
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
func NewSnapshot ¶
type SnapshotMap ¶
func NewSnapshotMap ¶
func NewSnapshotMap(c *cli.Context, tm *TorrentMap, s3 *cs.S3Client) *SnapshotMap
func (*SnapshotMap) WrapWriter ¶
func (s *SnapshotMap) WrapWriter(w http.ResponseWriter, h string) (http.ResponseWriter, error)
type SnapshotResponseWriter ¶
type SnapshotResponseWriter struct {
// contains filtered or unexported fields
}
func NewSnapshotResponseWriter ¶
func NewSnapshotResponseWriter(w http.ResponseWriter, sn *Snapshot, sm *SnapshotMap, h string) *SnapshotResponseWriter
func (*SnapshotResponseWriter) Header ¶
func (s *SnapshotResponseWriter) Header() http.Header
func (*SnapshotResponseWriter) Write ¶
func (s *SnapshotResponseWriter) Write(buf []byte) (int, error)
func (*SnapshotResponseWriter) WriteHeader ¶
func (s *SnapshotResponseWriter) WriteHeader(code int)
type Stat ¶
type Stat struct {
// contains filtered or unexported fields
}
func NewStat ¶
func NewStat(tm *TorrentMap) *Stat
func (*Stat) Files ¶
func (s *Stat) Files(ctx context.Context, _ *pb.FilesRequest) (*pb.FilesReply, error)
func (*Stat) StatStream ¶
func (s *Stat) StatStream(in *pb.StatRequest, stream pb.TorrentWebSeeder_StatStreamServer) error
type StatStreamServer ¶
type StatStreamServer struct {
// contains filtered or unexported fields
}
func NewStatStreamServer ¶
func NewStatStreamServer(ctx context.Context, w http.ResponseWriter, f http.Flusher) *StatStreamServer
func (*StatStreamServer) Context ¶
func (s *StatStreamServer) Context() context.Context
func (*StatStreamServer) Ping ¶
func (s *StatStreamServer) Ping()
func (*StatStreamServer) RecvMsg ¶
func (s *StatStreamServer) RecvMsg(m interface{}) error
func (*StatStreamServer) SendHeader ¶
func (s *StatStreamServer) SendHeader(m metadata.MD) error
func (*StatStreamServer) SendMsg ¶
func (s *StatStreamServer) SendMsg(m interface{}) error
func (*StatStreamServer) SetTrailer ¶
func (s *StatStreamServer) SetTrailer(m metadata.MD)
type ThrottledReader ¶
type ThrottledReader struct { io.ReadSeeker // contains filtered or unexported fields }
type TorrentClient ¶
type TorrentClient struct {
// contains filtered or unexported fields
}
func NewTorrentClient ¶
func NewTorrentClient(c *cli.Context) (*TorrentClient, error)
func (*TorrentClient) Close ¶
func (s *TorrentClient) Close()
type TorrentMap ¶
type TorrentMap struct {
// contains filtered or unexported fields
}
func NewTorrentMap ¶
func NewTorrentMap(tc *TorrentClient, tsm *TorrentStoreMap, fsm *FileStoreMap, tm *TouchMap) *TorrentMap
func (*TorrentMap) List ¶
func (s *TorrentMap) List() ([]string, error)
type TorrentStore ¶
type TorrentStore struct {
// contains filtered or unexported fields
}
func NewTorrentStore ¶
func NewTorrentStore(c *cli.Context) *TorrentStore
func (*TorrentStore) Close ¶
func (s *TorrentStore) Close()
func (*TorrentStore) Get ¶
func (s *TorrentStore) Get() (ts.TorrentStoreClient, error)
type TorrentStoreMap ¶
func NewTorrentStoreMap ¶
func NewTorrentStoreMap(ts *TorrentStore) *TorrentStoreMap
type TouchMap ¶
func NewTouchMap ¶
type WebSeeder ¶
type WebSeeder struct {
// contains filtered or unexported fields
}
func NewWebSeeder ¶
func NewWebSeeder(tm *TorrentMap, st *StatWeb, bp *BucketPool, sm *SnapshotMap) *WebSeeder
Source Files ¶
Click to show internal directories.
Click to hide internal directories.