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
A CLI has been provided to illustrate the functionality of the SDK. Simply run `go-sdk` for help.
49
-
```$sh
50
-
go-sdk provides cli access to your Optimizely fullstack project
51
-
52
-
Usage:
53
-
go-sdk [command]
54
-
55
-
Available Commands:
56
-
help Help about any command
57
-
is_feature_enabled Is feature enabled?
58
-
get_enabled_features Get enabled features
59
-
track Track a conversion event
60
-
get_feature_variable_boolean Get feature variable boolean value
61
-
get_feature_variable_double Get feature variable double value
62
-
get_feature_variable_integer Get feature variable integer value
63
-
get_feature_variable_string Get feature variable string value
64
-
65
-
Flags:
66
-
-h, --help help for go-sdk
67
-
-s, --sdkKey string Optimizely project SDK key
68
-
69
-
Use "go-sdk [command] --help" for more information about a command.
70
-
```
71
-
72
-
Each supported SDK API method is it's own [cobra](https://github.com/spf13/cobra) command and requires the
73
-
input of an `--sdkKey`.
6
+
## Installation
74
7
75
-
### Installation
76
-
Install the CLI from github:
8
+
### Install from github:
77
9
78
10
```$sh
79
11
go install github.com/optimizely/go-sdk
80
12
```
81
13
82
-
Install the CLI from source:
14
+
### Install from source:
83
15
```$sh
84
16
go get github.com/optimizely/go-sdk
85
17
cd $GOPATH/src/github.com/optimizely/go-sdk
@@ -89,20 +21,22 @@ go install
89
21
NOTE:
90
22
We practice trunk-based development, and as such our default branch, `master` might not always be the most stable. We do tag releases on Github and you can pin your installation to those particular release versions. One way to do this is to use [*Go Modules*](https://blog.golang.org/using-go-modules) for managing external dependencies:
91
23
24
+
### Install using go.mod:
25
+
92
26
```
93
27
module mymodule
94
28
95
29
go 1.12
96
30
97
31
require (
98
-
github.com/optimizely/go-sdk v1.0.0-beta2
32
+
github.com/optimizely/go-sdk v1.0.0-beta6
99
33
)
100
34
```
101
35
102
36
If you are already using `go.mod` in your application you can run the following:
0 commit comments