You can use go get
go get github.com/mehmetalisavas/cacoo
or you can clone into specific path with git clone
git clone [email protected]:mehmetalisavas/cacoo.git
This package implements the Cacoo api in Golang. No recommended go version is specified for this package. But also, still better to use latest version of go if posssible. If there is a misunderstanding points you can check the test cases. If you find bug or missing points, feel free to open a pull request. If you won't be able to do that, then please feel free to open an issue in repo (please use label when you open any issue on github; basically 'bug', 'enhancement' and 'question' would be enough to keep it simple).
// you can create client with token or without token
// (you won't be able to use many methods that requires api key)
client := NewClient("your token")
// you can fetch your account information with this
account, _, err := client.Account.MyAccountInformation(context.Background())
if err != nil {
// handle error
return err
}
myName := account.Name // you can use account name after using above method
myNickName := account.Nickname // you can reach nickname as well like this
Granted Client options are listed below:
- func OptionHttpClient(*http.Client) Option
- func OptionUserAgent(agent string) Option // use custom user agent
- func OptionBaseURL(url string) Option // sets the custom url for client
// TODO: Token also might be added via Option