piecelist

package
v1.123.1-rc Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module(ball *mud.Ball)

Module is a mud module.

Types

type Config

type Config struct {
	TargetDir string `help:"directory to collect csv files with piece IDs" default:"."`
	NodeID    string `help:"node ID of the Storagenode to collect piece IDs for"`
}

Config is the configuration for the piece list observer.

type Fork

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

Fork is a partial implementation that writes pieces to a file.

func (*Fork) Process

func (f *Fork) Process(ctx context.Context, segments []rangedloop.Segment) error

Process is called for each segment.

type PieceList

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

PieceList is an observer that collects piece IDs for a node.

func NewPieceList

func NewPieceList(cfg Config) (*PieceList, error)

NewPieceList creates a new piece list observer.

func (*PieceList) Finish

func (p *PieceList) Finish(ctx context.Context) error

Finish is called when the loop finishes.

func (*PieceList) Fork

func (p *PieceList) Fork(ctx context.Context) (rangedloop.Partial, error)

Fork is called when the loop forks.

func (*PieceList) Join

func (p *PieceList) Join(ctx context.Context, partial rangedloop.Partial) error

Join is called when the partial is done.

func (*PieceList) Start

func (p *PieceList) Start(ctx context.Context, time time.Time) error

Start is called when the loop starts.

Jump to

Keyboard shortcuts

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