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 ¶
- type FCRRegisterMgr
- func (mgr *FCRRegisterMgr) GetAllGateways() []register.GatewayRegistrar
- func (mgr *FCRRegisterMgr) GetAllProviders() []register.ProviderRegistrar
- func (mgr *FCRRegisterMgr) GetGateway(id *nodeid.NodeID) register.GatewayRegistrar
- func (mgr *FCRRegisterMgr) GetGatewayCIDRange(gatewayID *nodeid.NodeID) (*cid.ContentID, *cid.ContentID, error)
- func (mgr *FCRRegisterMgr) GetGatewaysNearCID(cID *cid.ContentID, numDHT int, notAllowed *nodeid.NodeID) ([]register.GatewayRegistrar, error)
- func (mgr *FCRRegisterMgr) GetProvider(id *nodeid.NodeID) register.ProviderRegistrar
- func (mgr *FCRRegisterMgr) Refresh()
- func (mgr *FCRRegisterMgr) RegisterGateway(gatewayRegistrar register.GatewayRegistrar) error
- func (mgr *FCRRegisterMgr) RegisterProvider(providerRegistrar register.ProviderRegistrar) error
- func (mgr *FCRRegisterMgr) Shutdown()
- func (mgr *FCRRegisterMgr) ShutdownAndWait()
- func (mgr *FCRRegisterMgr) Start() error
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.