Documentation ¶
Index ¶
- type Trader
- func (t *Trader) AdvertiseNeighborOffer(fromTrader, traderOffering *types.Node)
- func (t *Trader) CreateOffer(fromSupp *types.Node, newOffer *types.Offer)
- func (t *Trader) DebugSizeBytes() int
- func (t *Trader) GetOffers(ctx context.Context, _ *types.Node, relay bool) []types.AvailableOffer
- func (t *Trader) IsWorking() bool
- func (t *Trader) NumActiveOffers() int
- func (t *Trader) RefreshOffersSim()
- func (t *Trader) RemoveOffer(fromSupp *types.Node, offer *types.Offer)
- func (t *Trader) SpreadOffersSim()
- func (t *Trader) Start()
- func (t *Trader) Stop()
- func (t *Trader) UpdateOffer(fromSupp *types.Node, offer *types.Offer)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Trader ¶
type Trader struct { nodeCommon.NodeComponent // Base component // contains filtered or unexported fields }
Trader is responsible for managing offers from multiple suppliers and negotiate these offers with buyers. The resources combination that the trader can handle is described by its GUID.
func NewTrader ¶
func NewTrader(config *configuration.Configuration, overlay overlay.Overlay, client external.Kagetaka, guid guid.GUID, resourcesMapping *resources.Mapping) *Trader
NewTrader creates a new "virtual" trader.
func (*Trader) AdvertiseNeighborOffer ¶
Relay the offering advertise for the overlay neighbors if the trader doesn't have any available offers
func (*Trader) CreateOffer ¶
Receives a resource offer from other node (supplier) of the system
func (*Trader) DebugSizeBytes ¶
func (*Trader) RemoveOffer ¶
Remove an offer from the offering table.
Click to show internal directories.
Click to hide internal directories.