chunkinfo

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: BSD-3-Clause Imports: 32 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var (
	ErrInvalidNameOrAddress = errors.New("invalid name or aurora address")
	ErrNoResolver           = errors.New("no resolver connected")
	ErrNotFound             = errors.New("manifest: not found")
	ErrServerError          = errors.New("manifest: ServerError")
)

Functions

This section is empty.

Types

type BitVector added in v1.3.0

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

type BitVectorInfo added in v1.3.0

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, traversal traversal.Traverser,
	stateStorer storage.StateStorer, storer storage.Storer, route routetab.RouteTab, oracleChain chain.Resolver,
	resolver resolver.Interface, subPub subscribe.SubPub) *ChunkInfo

func (*ChunkInfo) API added in v1.3.0

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

func (*ChunkInfo) CancelFindChunkInfo

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

func (*ChunkInfo) DelChunkInfoSource added in v1.1.6

func (ci *ChunkInfo) DelChunkInfoSource(rootCid boson.Address) bool

func (*ChunkInfo) DelDiscover added in v1.0.9

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

func (*ChunkInfo) DelFile

func (ci *ChunkInfo) DelFile(rootCid boson.Address, del func() error) error

func (*ChunkInfo) DelManifest added in v1.3.5

func (ci *ChunkInfo) DelManifest(key string)

func (*ChunkInfo) FindChunkInfo

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

func (*ChunkInfo) GetChunkInfo

func (ci *ChunkInfo) GetChunkInfo(rootCid boson.Address, cid boson.Address) []aco.Route

func (*ChunkInfo) GetChunkInfoDiscoverOverlays

func (ci *ChunkInfo) GetChunkInfoDiscoverOverlays(rootCid boson.Address) []aurora.ChunkInfoOverlay

func (*ChunkInfo) GetChunkInfoServerOverlays

func (ci *ChunkInfo) GetChunkInfoServerOverlays(rootCid boson.Address) []aurora.ChunkInfoOverlay

func (*ChunkInfo) GetChunkInfoSource added in v1.1.6

func (ci *ChunkInfo) GetChunkInfoSource(rootCid boson.Address) aurora.ChunkInfoSourceApi

func (*ChunkInfo) GetChunkPyramid

func (ci *ChunkInfo) GetChunkPyramid(rootCid boson.Address) []*PyramidCidNum

func (*ChunkInfo) GetFileList

func (ci *ChunkInfo) GetFileList(overlay boson.Address) (fileListInfo []map[string]interface{}, rootList []boson.Address)

func (*ChunkInfo) GetManifest added in v1.3.5

func (ci *ChunkInfo) GetManifest(rootCid, pathVar string, depth int) (maniFest *ManifestNode)

func (*ChunkInfo) Init

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

func (*ChunkInfo) InitChunkInfo

func (ci *ChunkInfo) InitChunkInfo() error

func (*ChunkInfo) InitManifest added in v1.3.5

func (ci *ChunkInfo) InitManifest()

func (*ChunkInfo) IsDiscover

func (ci *ChunkInfo) IsDiscover(rootCid boson.Address) bool

func (*ChunkInfo) ManifestView added in v1.3.5

func (ci *ChunkInfo) ManifestView(ctx context.Context, nameOrHex, pathVar string, depth int) (*ManifestNode, error)

func (*ChunkInfo) Metrics

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

func (*ChunkInfo) OnChunkRetrieved added in v1.1.7

func (ci *ChunkInfo) OnChunkRetrieved(cid, rootCid, sourceOverlay boson.Address) error

func (*ChunkInfo) OnChunkTransferred

func (ci *ChunkInfo) OnChunkTransferred(cid, rootCid boson.Address, overlay, target boson.Address) error

func (*ChunkInfo) Protocol

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

func (*ChunkInfo) PublishDownloadProgress added in v1.3.5

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

func (*ChunkInfo) PublishRetrievalProgress added in v1.3.5

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

func (*ChunkInfo) PublishRootCidStatus added in v1.3.5

func (ci *ChunkInfo) PublishRootCidStatus(statusEvent RootCidStatusEven)

func (*ChunkInfo) SubscribeDownloadProgress added in v1.3.0

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

func (*ChunkInfo) SubscribeRetrievalProgress added in v1.3.0

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

func (*ChunkInfo) SubscribeRootCidStatus added in v1.3.0

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

func (*ChunkInfo) UpdateChunkInfoSource added in v1.1.6

func (ci *ChunkInfo) UpdateChunkInfoSource(rootCid, sourceOverlay boson.Address, cid boson.Address) error

func (*ChunkInfo) UpdatePyramidSource added in v1.1.6

func (ci *ChunkInfo) UpdatePyramidSource(rootCid, sourceOverlay boson.Address) error

type Interface

type Interface interface {
	FindChunkInfo(ctx context.Context, authInfo []byte, rootCid boson.Address, overlays []boson.Address) bool

	GetChunkInfo(rootCid boson.Address, cid boson.Address) []aco.Route

	GetChunkInfoDiscoverOverlays(rootCid boson.Address) []aurora.ChunkInfoOverlay

	GetChunkInfoServerOverlays(rootCid boson.Address) []aurora.ChunkInfoOverlay

	CancelFindChunkInfo(rootCid boson.Address)

	OnChunkTransferred(cid boson.Address, rootCid boson.Address, overlays, target boson.Address) error

	Init(ctx context.Context, authInfo []byte, rootCid boson.Address) bool

	GetChunkPyramid(rootCid boson.Address) []*PyramidCidNum

	IsDiscover(rootCid boson.Address) bool

	GetFileList(overlay boson.Address) (fileListInfo []map[string]interface{}, rootList []boson.Address)

	DelFile(rootCid boson.Address, del func() error) error

	DelDiscover(rootCid boson.Address)

	OnChunkRetrieved(cid, rootCid, sourceOverlay boson.Address) error

	GetChunkInfoSource(rootCid boson.Address) aurora.ChunkInfoSourceApi

	ManifestView(ctx context.Context, nameOrHex, pathVar string, depth int) (*ManifestNode, error)

	GetManifest(rootCid, pathVar string, depth int) (maniFest *ManifestNode)
}

type ManifestNode added in v1.3.5

type ManifestNode struct {
	Type      string                   `json:"type"`
	Hash      string                   `json:"hash,omitempty"`
	Name      string                   `json:"name,omitempty"`
	Size      uint64                   `json:"size,omitempty"`
	Extension string                   `json:"ext,omitempty"`
	MimeType  string                   `json:"mime,omitempty"`
	Nodes     map[string]*ManifestNode `json:"sub,omitempty"`
}

type Pull

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

type PyramidCidNum

type PyramidCidNum struct {
	Cid    boson.Address
	Number int
}

type Response

type Response struct {
	StatusCode int             `json:"code"`
	Message    string          `json:"msg"`
	Body       RootCIDResponse `json:"data"`
}

type RootCIDResponse

type RootCIDResponse struct {
	RootCID   string   `json:"rootcid"`
	Addresses []string `json:"addresses"`
}

type RootCidStatus added in v1.3.0

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

type RootCidStatusEven added in v1.3.0

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