chunkinfo

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PullMax    = 200
	PullingMax = 10
	PullerMax  = 1000
)
View Source
const (
	TimeOut = 30
	Time    = 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BitVector

type BitVector struct {
	Len int    `json:"len"`
	B   []byte `json:"b"`
}

type BitVectorInfo

type BitVectorInfo struct {
	RootCid   boson.Address
	Overlay   boson.Address
	Bitvector BitVector
}

type ChunkInfo

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

func New

func New(addr boson.Address, streamer p2p.Streamer, logger logging.Logger,
	chunkStore *localstore.DB, route routetab.RouteTab, oracleChain chain.Resolver, fileInfo fileinfo.Interface,
	subPub subscribe.SubPub) *ChunkInfo

func (*ChunkInfo) API

func (ci *ChunkInfo) API() rpc.API

func (*ChunkInfo) CancelFindChunkInfo added in v1.1.2

func (ci *ChunkInfo) CancelFindChunkInfo(rootCid boson.Address)

func (*ChunkInfo) Discover

func (ci *ChunkInfo) Discover(ctx context.Context, authInfo []byte, rootCid boson.Address, chain bool) bool

func (*ChunkInfo) FindChunkInfo

func (ci *ChunkInfo) FindChunkInfo(ctx context.Context, authInfo []byte, rootCid boson.Address, overlays []boson.Address) bool

func (*ChunkInfo) FindRoutes

func (ci *ChunkInfo) FindRoutes(_ context.Context, rootCid boson.Address, index int64) []aco.Route

func (*ChunkInfo) Metrics

func (ci *ChunkInfo) Metrics() []prometheus.Collector

func (*ChunkInfo) OnFileUpload

func (ci *ChunkInfo) OnFileUpload(ctx context.Context, rootCid boson.Address, length int64) error

func (*ChunkInfo) OnRetrieved

func (ci *ChunkInfo) OnRetrieved(ctx context.Context, rootCid boson.Address, index int64, overlay boson.Address) error

func (*ChunkInfo) OnTransferred

func (ci *ChunkInfo) OnTransferred(_ context.Context, rootCid boson.Address, index int64, overlay boson.Address) error

func (*ChunkInfo) Protocol

func (ci *ChunkInfo) Protocol() p2p.ProtocolSpec

func (*ChunkInfo) PublishDownloadProgress

func (ci *ChunkInfo) PublishDownloadProgress(rootCid boson.Address, bitV BitVectorInfo)

func (*ChunkInfo) PublishRetrievalProgress

func (ci *ChunkInfo) PublishRetrievalProgress(rootCid boson.Address, bitV BitVectorInfo)

func (*ChunkInfo) PublishRootCidStatus

func (ci *ChunkInfo) PublishRootCidStatus(statusEvent RootCidStatusEven)

func (*ChunkInfo) SubscribeDownloadProgress

func (ci *ChunkInfo) SubscribeDownloadProgress(notifier *rpc.Notifier, sub *rpc.Subscription, rootCids []boson.Address)

func (*ChunkInfo) SubscribeRetrievalProgress

func (ci *ChunkInfo) SubscribeRetrievalProgress(notifier *rpc.Notifier, sub *rpc.Subscription, rootCid boson.Address)

func (*ChunkInfo) SubscribeRootCidStatus

func (ci *ChunkInfo) SubscribeRootCidStatus(notifier *rpc.Notifier, sub *rpc.Subscription)

type Interface

type Interface interface {
	Discover(ctx context.Context, auth []byte, rootCid boson.Address, isOracle bool) bool

	FindRoutes(ctx context.Context, rootCid boson.Address, bit int64) []aco.Route

	OnRetrieved(ctx context.Context, rootCid boson.Address, bit int64, overlay boson.Address) error

	OnTransferred(ctx context.Context, rootCid boson.Address, bit int64, overlay boson.Address) error

	OnFileUpload(ctx context.Context, rootCid boson.Address, bitLen int64) error

	CancelFindChunkInfo(rootCid boson.Address)
}

type Pull

type Pull = uint32
const (
	UnPull Pull = iota
	Pulling
	Pulled
)

type RootCidStatus

type RootCidStatus = int
const (
	RootCid_DEL RootCidStatus = iota
	RootCid_ADD
)

type RootCidStatusEven

type RootCidStatusEven struct {
	RootCid boson.Address
	Status  RootCidStatus
}

Directories

Path Synopsis
Package pb holds only Protocol Buffer definitions and generated code.
Package pb holds only Protocol Buffer definitions and generated code.

Jump to

Keyboard shortcuts

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