Golang client to use shopemaa in your Go based projects.
- Add dependency
go get github.com/shopemaa/shopemaa-go-client
- Get Store Info
shopemaaClient := client.NewClient(
http.DefaultClient,
"https://api.shopemaa.com/query",
nil,
func(ctx context.Context, req *http.Request, gqlInfo *clientv2.GQLRequestInfo, res interface{}, next clientv2.RequestInterceptorFunc) error {
// Setup store credentials
req.Header.Set("store-key", os.Getenv("STORE_KEY"))
req.Header.Set("store-secret", os.Getenv("STORE_SECRET"))
return next(ctx, req, gqlInfo, res)
},
)
store := shopemaaClient.StoreBySecret(context.Background())
store.GetStoreBySecret().GetName()
Shopemaa Support: support@shopemaa.com
Licensed under the MIT License