You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The HearthstoneGo library provides the developer easy access to the Blizzard Hearthstone API. It handels all of the official API calls and supply the developer all the information they need.
9
+
10
+
## Get Getting Started
11
+
### Installing
12
+
Given that you have working Golang environment. If not refer to [here](https://golang.org/doc/install).
13
+
```
14
+
go get github.com/wltu/HearthstoneGo
15
+
```
16
+
17
+
### Simple Example
18
+
The `CLIENT_ID` and `CLIENT_SECRET` is created for the Blizzard API. Please follow the instruction [here](https://develop.battle.net/documentation/guides/getting-started) to create your own to use the library.
19
+
```
20
+
package main
21
+
22
+
import (
23
+
"fmt"
24
+
"os"
25
+
26
+
"github.com/wltu/HearthstoneGo/cmd/api"
27
+
)
28
+
29
+
func main() {
30
+
fmt.Println("Hello World!")
31
+
32
+
clientID := os.Getenv("CLIENT_ID")
33
+
clientSecret := os.Getenv("CLIENT_SECRET")
34
+
35
+
if client, ok := api.NewAPI("USA", clientID, clientSecret); ok {
36
+
fmt.Println(client.ClientToken)
37
+
38
+
// Search for single card.
39
+
client.SearchCard("52119-arch-villain-rafaam")
40
+
41
+
// Search for single card back.
42
+
client.SearchCardBack("155-pizza-stone")
43
+
44
+
// Search for a set of cards
45
+
client.BeginCardCollectionSearch()
46
+
47
+
// Set optional parameters.
48
+
// Visit card_collection.go for more info.
49
+
client.SetCardTextFilter("lookout")
50
+
51
+
client.EndCardCollectionSearch()
52
+
53
+
// Search for a set of card backs
54
+
client.BeginCardBackCollectionSearch()
55
+
56
+
// Set optional parameters.
57
+
// Visit card_back_collection.go for more info.
58
+
client.SetCardBackCategory("esports")
59
+
60
+
client.SetCardTextFilter("lookout")
61
+
62
+
client.EndCardBackCollectionSearch()
63
+
64
+
// Search for deck
65
+
id := "AAECAQcG+wyd8AKS+AKggAOblAPanQMMS6IE/web8wLR9QKD+wKe+wKz/AL1gAOXlAOalAOSnwMA"
66
+
client.SearchDeck(id)
67
+
68
+
} else {
69
+
fmt.Println("Error in setting up HearthstoneAPI Client!")
70
+
}
71
+
}
72
+
73
+
```
74
+
75
+
76
+
## Project Structure
9
77
This project follows loosely the proejct structure [here](https://github.com/golang-standards/project-layout).
10
78
11
-
###Design Document
79
+
## Design Document
12
80
The rough design document for the project can be found [here](https://docs.google.com/document/d/1hwWPqrOF7vG7u6qqmdCPqRR4Js99LyKEcchpjR17Z3E/edit?usp=sharing).
0 commit comments