Documentation ¶
Overview ¶
Package dealer
The `New` function type is intended to be implemented by your dealer plugin to integrate with the Hive application. When creating your plugin, ensure that the constructor function matches the signature of the `New` type. Additionally, export the above symbols so that they can be loaded dynamically by the Hive application at runtime.
Example usage of an example plugin:
package main import "context" import "hive/dealer" // MyDealer implements the Dealer interface. type MyDealer struct { ... } // DealMatched is the method that processes matched deals. func (d *MyDealer) DealMatched(dealID string) { ... } // DealsAgreed is the method that provides a channel of agreed deals. func (d *MyDealer) DealsAgreed() <-chan string { ... } // New creates a new instance of MyDealer. func New(ctx context.Context) Dealer { return &MyDealer{ ... } }
For more examples refer: https://github.com/CoopHive/hive/blob/main/exp/dealer
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dealer ¶
type Dealer interface { // DealMatched processes a deal identified by its unique ID. DealMatched(dealID string) // DealsAgreed returns a read-only channel that emits IDs of deals that have been agreed upon. DealsAgreed() <-chan string }
Dealer defines the interface for a plugin that manages deals within the Hive application. Implementations of this interface are expected to handle matched deals and provide a channel for agreed deals.