Unofficial Go client library for the Investec OpenAPI
To install ziggy
, use go get
:
go get github.com/nickcorin/ziggy
Import the ziggy
package into your code:
package main
import "github.com/nickcorin/ziggy"
func main() {
client := ziggy.NewClient("user", "s3cr3t")
}
client := ziggy.NewClient("user", "s3cr3t")
// You can chain configuration functions.
client := ziggy.NewClient("user", "s3cr3t").SetToken("mytoken")
// ...or you can configure it later.
client.SetProxy("https://proxy.ziggy.com")
token, err := client.GetAccessToken(context.Background(), ziggy.TokenScopeAccounts)
if err != nil {
log.Fatal(err)
}
accounts, err := z.GetAccounts(context.Background())
if err != nil {
log.Fatal(err)
}
balance, err := z.GetBalance(context.Background(), accounts[0].ID)
if err != nil {
log.Fatal(err)
}
Please feel free to submit issues, fork the repositoy and send pull requests!
This project is licensed under the terms of the MIT license.