Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/darrylmorley/go-lightspeed-retail
https://github.com/darrylmorley/go-lightspeed-retail
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/darrylmorley/go-lightspeed-retail
- Owner: darrylmorley
- Created: 2023-10-23T16:34:23.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-07T17:18:31.000Z (about 1 year ago)
- Last Synced: 2024-11-17T03:07:54.786Z (2 months ago)
- Language: Go
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A Lightspeed Retail SDK in Go!
To initialise the SDK:
```
func main() {
// Read values from .env or another source
baseURL := os.Getenv("BASE_URL")
clientID := os.Getenv("CLIENT_ID")
clientSecret := os.Getenv("CLIENT_SECRET")
refreshToken := os.Getenv("CLIENT_REFRESH_TOKEN")// Create a new SDK instance with the mock server's URL as the BaseURL
sdk := lightspeedsdk.NewSDK(baseURL, clientID, clientSecret, refreshToken)
// ...
}
```Example, call Categories:
```
err = sdk.DoGet("/Category", &response)
if err != nil {
t.Fatalf("Error fetching categories: %v", err)
}
fmt.Printf("Categories: %+v\n", response)
fmt.Println("Number of categories:", len(response))
```Currently only DoGet is implemented.