项目作者: localyyz

项目描述 :
Go library for accessing the Shopify REST API - (GoDocs coming soon)
高级语言: Go
项目地址: git://github.com/localyyz/go-shopify.git
创建时间: 2019-03-01T18:06:23Z
项目社区:https://github.com/localyyz/go-shopify

开源协议:BSD 3-Clause "New" or "Revised" License

下载


go-shopify

Go library for accessing the Shopify REST API - (GoDocs coming soon)

go-shopify requires Go version 1.9 or greater.

Usage

  1. import "github.com/localyyz/go-shopify" // v1

Construct a new Shopify client, then use the various services on the client to
access different parts of the Shopify API. For example:

  1. client := shopify.NewClient(nil, shopify.ShopURL("https://x.myshopify.com/admin"), shopify.Token("xxx-yyy-zzz"))
  2. // get the store metadata
  3. store, _, err := client.Shop.Get(context.Background())

Some API methods have optional parameters that can be passed. For example:

  1. client := shopify.NewClient(nil, shopify.ShopURL("https://x.myshopify.com/admin"), shopify.Token("xxx-yyy-zzz"))
  2. // create a new checkout
  3. checkout := &shopify.Checkout{Email: "paul@somebuyer.com"}
  4. checkout, _, err := client.Checkout.Create(context.Background(), checkout)

The services of a client divide the API into logical chunks and correspond to
the structure of the Shopify API documentation at
https://help.shopify.com/en/api/reference.

NOTE: Using the context package, one can easily
pass cancelation signals and deadlines to various services of the client for
handling a request. In case there is no context available, then context.Background()
can be used as a starting point.

Roadmap

This library is being initially developed for production use at
Localyyz, it’s now open sourced with the community to as the library have been
fairly stable for the past year or so. For future work / improvements:

  • tests coverage
  • example usage
  • documentation and GoDoc generation
  • complete REST api converage

Contributing

Feel free to fork and submit changes upstream. Please follow the pattern
established in this package. If you have questions feel free to submit issues,
for inspiration and guidelines please refer to the [google/go-github][] library.

License

This library is distributed under the BSD-style license found in the LICENSE
file.