Skip to content

Commit b7fc276

Browse files
committed
updated readme
1 parent 0cf536b commit b7fc276

File tree

5 files changed

+53
-41
lines changed

5 files changed

+53
-41
lines changed

.gitignore

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,32 @@ go-shopify
22
==========
33

44
Golang tool for connecting to Shopify's API
5+
6+
## Installation
7+
8+
You need to have Git and Go already installed.
9+
Run this in your terminal
10+
11+
```sh
12+
go get github.com/arduino/go-shopify
13+
```
14+
15+
## Usage
16+
17+
Import it in your Go code:
18+
19+
```go
20+
import (
21+
"github.com/arduino/go-shopify/shopify"
22+
)
23+
```
24+
25+
## Client Creation
26+
27+
To initialize a client you need the shopify private app password
28+
29+
```go
30+
shop := shopify.NewClient("your-shop-domain", "app-password")
31+
```
32+
33+
See functions used in example/example.go

example/example

-4.76 MB
Binary file not shown.

example/example.exe

-6.7 MB
Binary file not shown.

example/example.go

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
1-
package main
2-
3-
import (
4-
"fmt"
5-
"github.com/hammond-bones/go-shopify/shopify"
6-
"strconv"
7-
)
8-
9-
func main() {
10-
fmt.Printf("Hello!\n")
11-
shop := shopify.NewClient("mcglynn-quitzon-and-windler8990", "98bfc43d6aa771567326d76e6395173d")
12-
13-
shop.LoadProducts()
14-
15-
fmt.Printf("%v\n", shop.Products[0].Id)
16-
17-
prod := shop.GetLiveProduct(strconv.Itoa(shop.Products[0].Id))
18-
19-
fmt.Printf("%v\n", prod.Handle)
20-
}
1+
package main
2+
3+
import (
4+
"fmt"
5+
"strconv"
6+
7+
"github.com/arduino/go-shopify/shopify"
8+
)
9+
10+
func main() {
11+
fmt.Printf("Hello!\n")
12+
shop := shopify.NewClient("mcglynn-quitzon-and-windler8990", "98bfc43d6aa771567326d76e6395173d")
13+
14+
shop.LoadProducts()
15+
16+
fmt.Printf("%v\n", shop.Products[0].ID)
17+
18+
prod := shop.GetLiveProduct(strconv.Itoa(shop.Products[0].ID))
19+
20+
order := shop.GetOrder("123456")
21+
22+
fmt.Printf("%v\n", prod.Handle)
23+
fmt.Printf("%v\n", order)
24+
}

0 commit comments

Comments
 (0)