Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
188 changes: 0 additions & 188 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,194 +44,6 @@ user := entities.UserContext{
enabled, _ := client.IsFeatureEnabled("binary_feature", user)
```

## Command line interface
A CLI has been provided to illustrate the functionality of the SDK. Simply run `go-sdk` for help.
```$sh
go-sdk provides cli access to your Optimizely fullstack project

Usage:
go-sdk [command]

Available Commands:
help Help about any command
is_feature_enabled Is feature enabled?
get_enabled_features Get enabled features
track Track a conversion event
get_feature_variable_boolean Get feature variable boolean value
get_feature_variable_double Get feature variable double value
get_feature_variable_integer Get feature variable integer value
get_feature_variable_string Get feature variable string value

Flags:
-h, --help help for go-sdk
-s, --sdkKey string Optimizely project SDK key

Use "go-sdk [command] --help" for more information about a command.
```

Each supported SDK API method is it's own [cobra](https://github.com/spf13/cobra) command and requires the
input of an `--sdkKey`.

### Installation
Install the CLI from github:

```$sh
go install github.com/optimizely/go-sdk
```

Install the CLI from source:
```$sh
go get github.com/optimizely/go-sdk
cd $GOPATH/src/github.com/optimizely/go-sdk
go install
```

NOTE:
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:

```
module mymodule

go 1.12

require (
github.com/optimizely/go-sdk v1.0.0-beta2
)
```

If you are already using `go.mod` in your application you can run the following:

```
go mod edit -require github.com/optimizely/go-sdk@v1.0.0-beta2
```

NOTE:
```$sh
go get github.com/optimizely/go-sdk/...
```
or
```$sh
go get github.com/optimizely/go-sdk/pkg
```
will install it as a package to pkg directory, rather than src directory. It could be useful for future development and vendoring.

### Commands

#### is_feature_enabled
```
Determines if a feature is enabled

Usage:
go-sdk is_feature_enabled [flags]

Flags:
-f, --featureKey string feature key to enable
-h, --help help for is_feature_enabled
-u, --userId string user id

Global Flags:
-s, --sdkKey string Optimizely project SDK key
```

#### get_enabled_features
```
Returns enabled features for userId

Usage:
go-sdk get_enabled_features [flags]

Flags:
-h, --help help for get_enabled_features
-u, --userId string user id

Global Flags:
-s, --sdkKey string Optimizely project SDK key
```

#### track
```
Tracks a conversion event

Usage:
go-sdk track [flags]

Flags:
-e, --eventKey string event key to track
-h, --help help for track
-u, --userId string user id

Global Flags:
-s, --sdkKey string Optimizely project SDK key
```

#### get_feature_variable_boolean
```
Returns feature variable boolean value

Usage:
go-sdk get_feature_variable_boolean [flags]

Flags:
-f, --featureKey string feature key for feature
-v, --variableKey string variable key for feature variable
-h, --help help for get_feature_variable_boolean
-u, --userId string user id

Global Flags:
-s, --sdkKey string Optimizely project SDK key
```

#### get_feature_variable_double
```
Returns feature variable double value

Usage:
go-sdk get_feature_variable_double [flags]

Flags:
-f, --featureKey string feature key for feature
-v, --variableKey string variable key for feature variable
-h, --help help for get_feature_variable_double
-u, --userId string user id

Global Flags:
-s, --sdkKey string Optimizely project SDK key
```

#### get_feature_variable_integer
```
Returns feature variable integer value

Usage:
go-sdk get_feature_variable_integer [flags]

Flags:
-f, --featureKey string feature key for feature
-v, --variableKey string variable key for feature variable
-h, --help help for get_feature_variable_integer
-u, --userId string user id

Global Flags:
-s, --sdkKey string Optimizely project SDK key
```

#### get_feature_variable_string
```
Returns feature variable string value

Usage:
go-sdk get_feature_variable_string [flags]

Flags:
-f, --featureKey string feature key for feature
-v, --variableKey string variable key for feature variable
-h, --help help for get_feature_variable_string
-u, --userId string user id

Global Flags:
-s, --sdkKey string Optimizely project SDK key
```

## Credits

This software is distributed with code from the following open source projects:
Expand Down
57 changes: 0 additions & 57 deletions cmd/get_enabled_features.go

This file was deleted.

65 changes: 0 additions & 65 deletions cmd/get_feature_variable_boolean.go

This file was deleted.

65 changes: 0 additions & 65 deletions cmd/get_feature_variable_double.go

This file was deleted.

Loading