core

package
v0.0.0-...-b01a1fc Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package core - structure which represents a Provider's current state, including setting, configuration, references to all running Provider APIs of this instance.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Core

type Core struct {
	ProtocolVersion   int32
	ProtocolSupported []int32

	// Settings
	Settings *settings.AppSettings

	// PaymentMgr manages all payment related activities
	PaymentMgr *fcrpaymentmgr.FCRPaymentMgr

	// ProviderID of this provider
	ProviderID *nodeid.NodeID

	// Provider Private Key of this provider
	ProviderPrivateKey *fcrcrypto.KeyPair

	// ProviderPrivateKeyVersion is the key version number of the private key.
	ProviderPrivateKeyVersion *fcrcrypto.KeyVersion

	// RegisterMgr manages all register related activities
	RegisterMgr *fcrregistermgr.FCRRegisterMgr

	// P2PServer handles all communication to/from gateways/providers
	P2PServer *fcrp2pserver.FCRP2PServer

	// RESTServer handles all communication to/from client/admin
	RESTServer *fcrrestserver.FCRRESTServer

	// Offer Manager
	OffersMgr *fcroffermgr.FCROfferMgr

	// Node to offer map, TODO: Use a manager
	NodeOfferMap     map[string][]cidoffer.CIDOffer
	NodeOfferMapLock sync.Mutex

	// Acknowledgement for every single cid offer sent (map from cid id -> map of gateway -> ack)
	AcknowledgementMap     map[string]map[string]DHTAcknowledgement
	AcknowledgementMapLock sync.RWMutex

	// List of Gateways that allow group CID offer to be published
	GroupOfferGatewayIDs []nodeid.NodeID
}

Core holds the main data structure for the whole provider

func GetSingleInstance

func GetSingleInstance(confs ...*settings.AppSettings) *Core

GetSingleInstance returns the single instance of the provider

type DHTAcknowledgement

type DHTAcknowledgement struct {
	Msg    fcrmessages.FCRMessage // Original message
	MsgAck fcrmessages.FCRMessage // Original message ACK
}

DHTAcknowledgement stores the acknowledgement of a single cid offer

Jump to

Keyboard shortcuts

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