Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregator ¶
type Aggregator struct {
// contains filtered or unexported fields
}
Aggregator collects and returns price quotes from a set of downstream providers.
func NewAggregator ¶
func NewAggregator(vendorID string, providerAddrs []string) *Aggregator
NewAggregator returns a new Aggregator instance that queries the providers at providerAddrs and returns back the results.
func (*Aggregator) GetQuote ¶
func (a *Aggregator) GetQuote(ctx context.Context, req *proto.QuotesRequest) (*proto.QuotesResponse, error)
GetQuote implements proto.QuoteServiceServer.
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
Gateway simulates an API gateway that would handle requests from a front-end.
func NewGateway ¶
NewGateway returns a Gateway that retrieves quotes from a downstream aggregator listening at aggrAddr.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider simulates a vendor service that returns price quotes for an SKU.
func NewProvider ¶
NewProvider returns a new Provider instance with the specified vendor ID.
func (*Provider) GetQuote ¶
func (p *Provider) GetQuote(ctx context.Context, req *proto.QuotesRequest) (*proto.QuotesResponse, error)
GetQuote implements proto.QuoteServiceServer.
Click to show internal directories.
Click to hide internal directories.