Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/uchencho/okrago
Okra API wrapper in Go
https://github.com/uchencho/okrago
go golang okra
Last synced: 6 days ago
JSON representation
Okra API wrapper in Go
- Host: GitHub
- URL: https://github.com/uchencho/okrago
- Owner: Uchencho
- Created: 2020-07-20T13:59:03.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-16T21:11:15.000Z (over 4 years ago)
- Last Synced: 2024-06-20T05:29:04.754Z (7 months ago)
- Topics: go, golang, okra
- Language: Go
- Homepage:
- Size: 3.62 MB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OkraGo
[Okra](https://okra.ng/) API wrapper in Go
## Usage
### Install Package
```bash
go get github.com/Uchencho/OkraGo
```Documentation
-------------
Please see https://docs.okra.ng/ for the most up-to-date documentation for the OKRA API.#### OKRA
```go
package mainimport (
"fmt"
"os"
okra "github.com/Uchencho/OkraGo"
)token := os.Getenv("OKRA_TOKEN")
const sandboxUrl = "https://api.okra.ng/sandbox/v1/"
```* Initialize a client
```go
func main () {
okraClient, err := okra.New(token, sandboxUrl)
if err != nil {
fmt.Println(err)
}
//okraClient returns an error if token or sandboxUrl is empty
body, err2 := okraClient.RetrieveTransaction()
if err != nil {
log.Println(err2)
}
fmt.Println(body.Data,"\n\n", body.StatusCode)
/*
okraClient has access to all the products OKRA API offers
*/
}
```
Use Product Name to Access Underlying Resources... ![](https://github.com/Uchencho/OkraGo/blob/master/client/okra.gif)>**NOTE**
>Check the `client` directory to see a sample implementation