Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertCurrency ¶
Convert an amount between two currencies. Uses historical exchange rates for the given timestamp.
Types ¶
type LRUCache ¶
type LRUCache struct {
// contains filtered or unexported fields
}
LRU cache is an in-memory implementation of the OXR cache interface using an LRU as the caching method.
type MongoCache ¶
type MongoCache struct {
// contains filtered or unexported fields
}
Mongo Cache is a MongoDB implementation of the OXR cache. It uses an existing mgo session to connect to MongoDB rather than setting up it's own.
func NewMongoCache ¶
func NewMongoCache(session *mgo.Session, db string, collection string) *MongoCache
Create a new Mongo cache with the given target database and collection
type NotFoundError ¶
type NotFoundError struct{}
func (NotFoundError) Error ¶
func (e NotFoundError) Error() string
type Rates ¶
type Rates struct { ID string `json:"id" bson:"_id"` License string `json:"license" bson:"license"` Timestamp int `json:"timestamp" bson:"timestamp"` Base string `json:"base" bson:"base"` Rates map[string]float64 `json:"rates" bson:"rates"` }
func Historical ¶
Returns historical rates for the given date string, formatted as "yyyy-mm-dd"
Click to show internal directories.
Click to hide internal directories.