Skip to content
This repository was archived by the owner on Jul 24, 2021. It is now read-only.

jagregory/gopenexchangerates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gopenexchangerates

Open Exchange Rates client for Go. Doesn't do much.

Install

go get github.com/jagregory/gopenexchangerates

Usage

import (
  oxr "github.com/jagregory/gopenexchangerates"
)

xr := oxr.New("your-app-id")
err := rx.Populate()
if err != nil {
  // err
}
v, err := rx.Get("AUD") // 1.543

Populate fetches the exchange rates from Open Exchange Rates. Call this method whenever you want to update the cached copy of the rates. Be kind to Open Exchange Rates and don't hammer them.

// update exchange rates every 2 hours
go func() {
  for {
    rx.Populate()
    time.Sleep(2 * time.Hour)
  }
}()

About

Open Exchange Rates (http://openexchangerates.org) client in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages