pushsync

package
v0.0.0-...-c9321c3 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Overview

Package pushsync provides the pushsync protocol implementation.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOutOfDepthReplication = errors.New("replication outside of the neighborhood")
	ErrNoPush                = errors.New("could not push chunk")
)

Functions

This section is empty.

Types

type PushSync

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

func New

func New(address penguin.Address, streamer p2p.StreamerDisconnecter, storer storage.Putter, topology topology.Driver, tagger *tags.Tags, isFullNode bool, unwrap func(penguin.Chunk), validStamp func(penguin.Chunk, []byte) (penguin.Chunk, error), logger logging.Logger, accounting accounting.Interface, pricer pricer.Interface, signer crypto.Signer, tracer *tracing.Tracer) *PushSync

func (*PushSync) Metrics

func (s *PushSync) Metrics() []prometheus.Collector

func (*PushSync) Protocol

func (s *PushSync) Protocol() p2p.ProtocolSpec

func (*PushSync) PushChunkToClosest

func (ps *PushSync) PushChunkToClosest(ctx context.Context, ch penguin.Chunk) (*Receipt, error)

PushChunkToClosest sends chunk to the closest peer by opening a stream. It then waits for a receipt from that peer and returns error or nil based on the receiving and the validity of the receipt.

type PushSyncer

type PushSyncer interface {
	PushChunkToClosest(ctx context.Context, ch penguin.Chunk) (*Receipt, error)
}

type Receipt

type Receipt struct {
	Address   penguin.Address
	Signature []byte
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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