seeder

package
v0.0.0-...-e836074 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileEntry

type FileEntry struct {
	Path   string
	Chunk  int64
	Offset int64
	Size   int64
}

type FileIndex

type FileIndex struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*FileIndex) Add

func (index *FileIndex) Add(path string, tracker *trackerv1.Tracker)

func (*FileIndex) Get

func (index *FileIndex) Get(hash []byte, chunk int64) (*FileEntry, bool)

func (*FileIndex) Scan

func (index *FileIndex) Scan(hash []byte) *bitset.BitSet

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

func (*Pool) Get

func (pool *Pool) Get(ctx context.Context) bool

func (*Pool) Put

func (pool *Pool) Put()

type Seeder

type Seeder struct {
	Addr     string
	Insecure bool
	// contains filtered or unexported fields
}

func New

func New(addr string, insecure bool, poolsize int, tlsConfig *tls.Config) *Seeder

func (*Seeder) Announce

func (seeder *Seeder) Announce(ctx context.Context, tracker *trackerv1.Tracker, addr string) error

func (*Seeder) Fetch

func (seeder *Seeder) Fetch(ctx context.Context, req *connect.Request[seederv1.FetchRequest]) (*connect.Response[seederv1.FetchResponse], error)

func (*Seeder) Has

func (seeder *Seeder) Has(ctx context.Context, req *connect.Request[seederv1.HasRequest]) (*connect.Response[seederv1.HasResponse], error)

func (*Seeder) ListenAndServe

func (seeder *Seeder) ListenAndServe(ctx context.Context) error

func (*Seeder) Seed

func (seeder *Seeder) Seed(ctx context.Context, path string, tracker *trackerv1.Tracker) error

Seed verifies that the given tracker matches the file at the path and begins announcing seeding capacities to the taverns listed in the tracker. All background routines keep running until the context is canceled.

Jump to

Keyboard shortcuts

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