fcrregistermgr

package
v0.0.0-...-12ab560 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2021 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Overview

Package fcrregistermgr - provides network API methods to work with FileCoin Secondary Retrieval Manager. This package uses core Register functionality from `register` package internally.

Retrieval Register is a central node, holding information about Retrieval Gateways and Retrieval Providers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FCRRegisterMgr

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

FCRRegisterMgr Register Manager manages the internal storage of registered nodes.

func NewFCRRegisterMgr

func NewFCRRegisterMgr(registerAPI string, providerDiscv bool, gatewayDiscv bool, refreshDuration time.Duration) *FCRRegisterMgr

NewFCRRegisterMgr creates a new register manager.

func (*FCRRegisterMgr) GetAllGateways

func (mgr *FCRRegisterMgr) GetAllGateways() []register.GatewayRegistrar

GetAllGateways returns all discovered gateways.

func (*FCRRegisterMgr) GetAllProviders

func (mgr *FCRRegisterMgr) GetAllProviders() []register.ProviderRegistrar

GetAllProviders returns all discovered providers.

func (*FCRRegisterMgr) GetGateway

func (mgr *FCRRegisterMgr) GetGateway(id *nodeid.NodeID) register.GatewayRegistrar

GetGateway returns a gateway register if found.

func (*FCRRegisterMgr) GetGatewayCIDRange

func (mgr *FCRRegisterMgr) GetGatewayCIDRange(gatewayID *nodeid.NodeID) (*cid.ContentID, *cid.ContentID, error)

GetGatewayCIDRange gets the cid max and cid min of this gateway at start up

func (*FCRRegisterMgr) GetGatewaysNearCID

func (mgr *FCRRegisterMgr) GetGatewaysNearCID(cID *cid.ContentID, numDHT int, notAllowed *nodeid.NodeID) ([]register.GatewayRegistrar, error)

GetGatewaysNearCID returns a list of gatewayRegisters whose id is close to the given cid.

func (*FCRRegisterMgr) GetProvider

func (mgr *FCRRegisterMgr) GetProvider(id *nodeid.NodeID) register.ProviderRegistrar

GetProvider returns a provider register if found.

func (*FCRRegisterMgr) Refresh

func (mgr *FCRRegisterMgr) Refresh()

Refresh refreshes the internal map immediately.

func (*FCRRegisterMgr) RegisterGateway

func (mgr *FCRRegisterMgr) RegisterGateway(gatewayRegistrar register.GatewayRegistrar) error

RegisterGateway to register a gateway

func (*FCRRegisterMgr) RegisterProvider

func (mgr *FCRRegisterMgr) RegisterProvider(providerRegistrar register.ProviderRegistrar) error

RegisterProvider to register a provider

func (*FCRRegisterMgr) Shutdown

func (mgr *FCRRegisterMgr) Shutdown()

Shutdown will shutdown the register manager.

func (*FCRRegisterMgr) ShutdownAndWait

func (mgr *FCRRegisterMgr) ShutdownAndWait()

ShutdownAndWait stop the register manager Initiates register manager blocking shutdown (waiting for all parties before return)

func (*FCRRegisterMgr) Start

func (mgr *FCRRegisterMgr) Start() error

Start starts a thread to auto update the internal map every given duration.

Jump to

Keyboard shortcuts

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