Skip to content

Commit 42c8a23

Browse files
committed
initial release of GO Lang SDK for CF
1 parent 60f10c9 commit 42c8a23

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+5317
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
bin/
2+
.token
3+
main.exe

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/ff-golang-server-sdk.iml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
GOLANGCI_LINT_VERSION=v1.10.2
2+
3+
LINTER=./bin/golangci-lint
4+
5+
.PHONY: build clean test lint
6+
7+
generate:
8+
oapi-codegen -generate client,spec -package=rest ./api.yaml > ./pkg/rest/services.gen.go
9+
oapi-codegen -generate types -package=rest ./api.yaml > ./pkg/rest/types.gen.go
10+
11+
build:
12+
go build ./...
13+
14+
clean:
15+
go clean
16+
17+
test:
18+
go test -race -v --cover ./pkg/...
19+
20+
$(LINTER):
21+
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s $(GOLANGCI_LINT_VERSION)
22+
23+
lint: $(LINTER)
24+
$(LINTER) run ./...

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Harness FFM Server-side SDK for Go
2+
3+
## FFM overview
4+
FFM is feature flag management platform for helping teams to deliver better software and faster.
5+
6+
## Supported GO versions
7+
This version of FFM has been tested with GO 1.14
8+
9+
## Install
10+
`go get github.com/wings-software/ff-client-sdk-go`
11+
12+
## Usage
13+
First we need to import lib with harness alias
14+
`import harness "github.com/wings-software/ff-client-sdk-go/pkg/api"`
15+
16+
Next we create client instance for interaction with api
17+
`client := harness.NewClient(sdkKey)`
18+
19+
Target definition can be user, device, app etc.
20+
```
21+
target := dto.NewTargetBuilder("key").
22+
Firstname("John").
23+
Lastname("doe").
24+
25+
Country("USA").
26+
Custom("height", 160).
27+
Build()
28+
```
29+
30+
Evaluating Feature Flag
31+
`showFeature, err := client.BoolVariation(featureFlagKey, target, false)`
32+
33+
34+
## for installing private repositories follow this guide:
35+
36+
`go env -w GOPRIVATE=github.com/wings-software`
37+
38+
[link](https://medium.com/swlh/go-modules-with-private-git-repository-3940b6835727)

0 commit comments

Comments
 (0)