ppspp

package
v0.0.0-...-249e25c Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: AGPL-3.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolVersion        uint8 = 2
	MinimumProtocolVersion uint8 = 2
)

protocol ooptions

Variables

View Source
var (
	ErrInvalidURI = errors.New("invalid uri")
)

errors ...

Functions

This section is empty.

Types

type ChannelReader

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

ChannelReader ...

func (*ChannelReader) HandleMessage

func (c *ChannelReader) HandleMessage(b []byte) (err error)

HandleMessage ...

type Conn

type Conn interface {
	ioutil.BufferedWriteFlusher
	SetQOSWeight(w uint64)
}

Conn ...

type DeliveryMode

type DeliveryMode int
const (
	LowLatencyDeliveryMode DeliveryMode
	BestEffortDeliveryMode
	MandatoryDeliveryMode
)

type MetricsSnapshot

type MetricsSnapshot struct {
	Read  TransferMetricsSnapshot
	Write TransferMetricsSnapshot
}

type PeerMetricsSnapshot

type PeerMetricsSnapshot struct {
	MetricsSnapshot
	Swarms map[*Swarm]MetricsSnapshot
}

type Runner

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

func NewRunner

func NewRunner(ctx context.Context, logger *zap.Logger) *Runner

func (*Runner) RunPeer

func (r *Runner) RunPeer(id []byte, w Conn) (*ChannelReader, *RunnerPeer)

type RunnerPeer

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

RunnerPeer ...

func (*RunnerPeer) MetricsSnapshot

func (p *RunnerPeer) MetricsSnapshot(t timeutil.Time) PeerMetricsSnapshot

func (*RunnerPeer) RunSwarm

func (p *RunnerPeer) RunSwarm(s *Swarm, channel, peerChannel codec.Channel) error

RunSwarm ...

func (*RunnerPeer) Stop

func (p *RunnerPeer) Stop()

Stop ...

func (*RunnerPeer) StopSwarm

func (p *RunnerPeer) StopSwarm(s *Swarm)

StopSwarm ...

type SchedulingMethod

type SchedulingMethod int
const (
	SeedSchedulingMethod SchedulingMethod = iota + 1
	PeerSchedulingMethod
)

type Swarm

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

Swarm ...

func NewDefaultSwarm

func NewDefaultSwarm(id SwarmID) (s *Swarm)

NewDefaultSwarm ...

func NewSwarm

func NewSwarm(id SwarmID, o SwarmOptions) (*Swarm, error)

NewSwarm ...

func (*Swarm) Close

func (s *Swarm) Close() error

Close ...

func (*Swarm) ExportCache

func (s *Swarm) ExportCache() (*swarmpb.Cache, error)

func (*Swarm) ID

func (s *Swarm) ID() SwarmID

ID ...

func (*Swarm) ImportCache

func (s *Swarm) ImportCache(c *swarmpb.Cache) error

func (*Swarm) Reader

func (s *Swarm) Reader() *store.BufferReader

Reader ...

func (*Swarm) URI

func (s *Swarm) URI() *URI

URI ...

type SwarmID

type SwarmID []byte

SwarmID ...

func DecodeSwarmID

func DecodeSwarmID(key string) (SwarmID, error)

DecodeSwarmID ...

func NewSwarmID

func NewSwarmID(key []byte) SwarmID

NewSwarmID ...

func (SwarmID) Compare

func (s SwarmID) Compare(o SwarmID) int

Compare ...

func (SwarmID) Equals

func (s SwarmID) Equals(o SwarmID) bool

Equals ...

func (SwarmID) String

func (s SwarmID) String() string

String ...

type SwarmOptions

type SwarmOptions struct {
	Label              string
	ChunkSize          int
	ChunksPerSignature int
	StreamCount        int
	LiveWindow         int
	Integrity          integrity.VerifierOptions
	SchedulingMethod   SchedulingMethod
	DeliveryMode       DeliveryMode
	BufferLayout       store.BufferLayout
}

SwarmOptions ...

func NewDefaultSwarmOptions

func NewDefaultSwarmOptions() SwarmOptions

NewDefaultSwarmOptions ...

func (SwarmOptions) IntegrityVerifierOptions

func (o SwarmOptions) IntegrityVerifierOptions() integrity.SwarmVerifierOptions

IntegrityVerifierOptions ...

func (SwarmOptions) IntegrityWriterOptions

func (o SwarmOptions) IntegrityWriterOptions() integrity.SwarmWriterOptions

IntegrityWriterOptions ...

func (SwarmOptions) URIOptions

func (o SwarmOptions) URIOptions() URIOptions

URIOptions ...

type TransferMetricsSnapshot

type TransferMetricsSnapshot struct {
	Count uint64
	Rate  uint64
}

type URI

type URI struct {
	ID      SwarmID
	Options URIOptions
}

URI ...

func NewURI

func NewURI(id SwarmID, options URIOptions) *URI

NewURI ...

func ParseURI

func ParseURI(s string) (u *URI, err error)

ParseURI ...

func (*URI) String

func (u *URI) String() string

String ...

type URIOptions

type URIOptions map[codec.ProtocolOptionType]int

URIOptions ...

func (URIOptions) SwarmOptions

func (o URIOptions) SwarmOptions() SwarmOptions

SwarmOptions ...

type Writer

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

Writer ...

func NewWriter

func NewWriter(o WriterOptions) (*Writer, error)

NewWriter ...

func (*Writer) Close

func (w *Writer) Close() (err error)

Close shut down the swarm...

func (*Writer) Flush

func (w *Writer) Flush() error

Flush ...

func (*Writer) Reset

func (w *Writer) Reset()

Reset ...

func (*Writer) Swarm

func (w *Writer) Swarm() *Swarm

Swarm ...

func (*Writer) Write

func (w *Writer) Write(p []byte) (int, error)

Write ...

type WriterOptions

type WriterOptions struct {
	SwarmOptions SwarmOptions
	Key          *key.Key
}

WriterOptions ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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