Documentation
¶
Index ¶
- Constants
- func NewRegistry(registries ...ProposalRegistry) *registryComposite
- func NewRepository() *repository
- func NewWorker(workers ...Worker) *workerComposite
- type Discovery
- type PriceInfoProvider
- type PricedServiceProposalRepository
- func (pspr *PricedServiceProposalRepository) Countries(filter *proposal.Filter) (map[string]int, error)
- func (pspr *PricedServiceProposalRepository) EnrichProposalWithPrice(in market.ServiceProposal) (proposal.PricedServiceProposal, error)
- func (pspr *PricedServiceProposalRepository) Proposal(id market.ProposalID) (*proposal.PricedServiceProposal, error)
- func (pspr *PricedServiceProposalRepository) Proposals(filter *proposal.Filter) ([]proposal.PricedServiceProposal, error)
- type ProposalRegistry
- type Status
- type Worker
Constants ¶
const ( // AppTopicProposalAdded represents newly announced proposal AppTopicProposalAdded = "ProposalAdded" // AppTopicProposalUpdated represents re-announced proposal AppTopicProposalUpdated = "ProposalUpdated" // AppTopicProposalRemoved represents newly de-announced proposal AppTopicProposalRemoved = "ProposalRemoved" // AppTopicProposalAnnounce represent proposal events topic. AppTopicProposalAnnounce = "proposalEvent" )
Topic represents the different topics a consumer can subscribe to
Variables ¶
This section is empty.
Functions ¶
func NewRegistry ¶
func NewRegistry(registries ...ProposalRegistry) *registryComposite
NewRegistry creates an instance of composite registry
func NewRepository ¶
func NewRepository() *repository
NewRepository constructs a new composite repository.
Types ¶
type Discovery ¶
type Discovery struct {
// contains filtered or unexported fields
}
Discovery structure holds discovery service state
func NewService ¶
func NewService( identityRegistry registry.IdentityRegistry, proposalRegistry ProposalRegistry, proposalPingTTL time.Duration, signerCreate identity.SignerFactory, eventBus eventbus.EventBus, ) *Discovery
NewService creates new discovery service
type PriceInfoProvider ¶
type PriceInfoProvider interface {
GetCurrentPrice(nodeType string, country string, serviceType string) (market.Price, error)
}
PriceInfoProvider allows to fetch the current pricing for services.
type PricedServiceProposalRepository ¶
type PricedServiceProposalRepository struct {
// contains filtered or unexported fields
}
PricedServiceProposalRepository enriches proposals with price data as pricing data is not available on raw proposals.
func NewPricedServiceProposalRepository ¶
func NewPricedServiceProposalRepository(baseRepo proposal.Repository, pip PriceInfoProvider, filterPresets proposal.FilterPresetRepository) *PricedServiceProposalRepository
NewPricedServiceProposalRepository returns a new instance of PricedServiceProposalRepository.
func (*PricedServiceProposalRepository) Countries ¶
func (pspr *PricedServiceProposalRepository) Countries(filter *proposal.Filter) (map[string]int, error)
Countries fetches number of proposals per country from base repository.
func (*PricedServiceProposalRepository) EnrichProposalWithPrice ¶
func (pspr *PricedServiceProposalRepository) EnrichProposalWithPrice(in market.ServiceProposal) (proposal.PricedServiceProposal, error)
EnrichProposalWithPrice adds pricing info to service proposal.
func (*PricedServiceProposalRepository) Proposal ¶
func (pspr *PricedServiceProposalRepository) Proposal(id market.ProposalID) (*proposal.PricedServiceProposal, error)
Proposal fetches the proposal from base repository and enriches it with pricing data.
func (*PricedServiceProposalRepository) Proposals ¶
func (pspr *PricedServiceProposalRepository) Proposals(filter *proposal.Filter) ([]proposal.PricedServiceProposal, error)
Proposals fetches proposals from base repository and enriches them with pricing data.
type ProposalRegistry ¶
type ProposalRegistry interface { RegisterProposal(proposal market.ServiceProposal, signer identity.Signer) error PingProposal(proposal market.ServiceProposal, signer identity.Signer) error UnregisterProposal(proposal market.ServiceProposal, signer identity.Signer) error }
ProposalRegistry defines methods for proposal lifecycle - registration, keeping up to date, removal