Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exchanger ¶
type Exchanger interface { // Exchange will perform the conversion Exchange(ctx context.Context, basePrice float64, currency string) (float64, error) }
Exchanger will convert from one currency to another
type Person ¶
Person is a copy/sub-set of data.Person so that the relationship does not leak. It also allows us to remove/hide and internal fields
type Registerer ¶
type Registerer struct {
// contains filtered or unexported fields
}
Registerer validates the supplied person, calculates the price in the requested currency and saves the result. It will return an error when: -the person object does not include all the fields -the currency is invalid -the exchange rate cannot be loaded -the data layer throws an error.
func NewRegisterer ¶
func NewRegisterer(cfg Config, exchanger Exchanger) *Registerer
NewRegisterer creates and initializes a Registerer
Click to show internal directories.
Click to hide internal directories.