Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
43 changes: 42 additions & 1 deletion website/.ci/sdkVersions.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type Versions struct {
Pypi Pypi `json:"pypi,omitempty"`
Nuget Nuget `json:"nuget,omitempty"`
GO GO `json:"go,omitempty"`
Swift Swift `json:"swift,omitempty"`
}
type Maven struct {
Sdk string `json:"sdk,omitempty"`
Expand All @@ -43,6 +44,10 @@ type Nuget struct {
Provider string `json:"provider,omitempty"`
}

type Swift struct {
Provider string `json:"provider,omitempty"`
}

type GO struct {
Provider string `json:"provider,omitempty"`
SDK string `json:"sdk,omitempty"`
Expand All @@ -51,7 +56,11 @@ type GO struct {
func main() {
var wg sync.WaitGroup
versions := Versions{}
wg.Add(14)
wg.Add(15)
go func() {
defer wg.Done()
versions.Swift.Provider = getSwiftVersion("go-feature-flag/openfeature-swift-provider")
}()
go func() {
defer wg.Done()
versions.Maven.Android = getMavenVersion("dev.openfeature", "android-sdk")
Expand Down Expand Up @@ -296,3 +305,35 @@ func getGOVersion(packageName string) string {
}
return res.Version
}

func getSwiftVersion(repoSlug string) string {
//
u := url.URL{
Scheme: "https",
Host: "api.github.com",
Path: fmt.Sprintf("repos/%s/releases/latest", repoSlug),
}

resp, err := http.Get(u.String())
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()

body, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}

type githubRes struct {
TagName string `json:"tag_name,omitempty"`
}

var res githubRes
err = json.Unmarshal(body, &res)
if err != nil {
log.Fatal(err)
}

return res.TagName
}
15 changes: 8 additions & 7 deletions website/docs/sdk/client_providers/openfeature_swift.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ sidebar_position: 20
title: Swift
description: How to use the OpenFeature Swift SDK for your iOS/tvOS/macOS application
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import versions from '@site/static/sdk-versions.json';
import CodeBlock from '@theme/CodeBlock';

# Swift SDK
[![version](https://img.shields.io/github/v/release/go-feature-flag/openfeature-swift-provider?label=Swift&display_name=tag&style=flat-square&logo=Swift)](https://github.com/go-feature-flag/openfeature-swift-provider)

In conjuction with the [OpenFeature SDK](https://openfeature.dev/docs/reference/concepts/provider) you will be able to evaluate your feature flags in your **iOS**/**tvOS**/**macOS** applications.

For documentation related to flags management in GO Feasture Flag, refer to the [GO Feature Flag documentation website](https://gofeatureflag.org/docs).
For documentation related to flags management in GO Feature Flag, refer to the [GO Feature Flag documentation website](https://gofeatureflag.org/docs).

### Functionalities:
- Managed the integration of the OpenFeature Swift SDK and GO Feature Flag relay-proxy.
Expand All @@ -23,9 +23,11 @@ For documentation related to flags management in GO Feasture Flag, refer to the
### Swift Package Manager

In the dependencies section of Package.swift add:
```swift
.package(url: "https://github.com/go-feature-flag/openfeature-swift-provider.git", from: "0.1.0")
```
<CodeBlock
language="swift">
.package(url: "https://github.com/go-feature-flag/openfeature-swift-provider.git", from: "{versions.swift.provider.substr(1, versions.swift.provider.length)}")
</CodeBlock>


and in the target dependencies section add:
```swift
Expand Down Expand Up @@ -58,7 +60,6 @@ The only required option to create a `GoFeatureFlagProvider` is the URL to your
import GOFeatureFlag
import OpenFeature


let options = GoFeatureFlagProviderOptions(endpoint: "https://your_domain.io")
let provider = GoFeatureFlagProvider(options: options)

Expand Down
30 changes: 29 additions & 1 deletion website/static/sdk-versions.json
Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
{"maven":{"sdk":"1.13.0","providerKt":"0.2.0","providerJava":"0.4.0","android":"0.3.2"},"npm":{"core":"1.6.0","webSDK":"1.4.0","providerServer":"0.7.3","providerWeb":"0.2.3"},"pypi":{"sdk":"0.7.4","provider":"0.3.0"},"nuget":{"sdk":"2.2.0","provider":"0.2.0"},"go":{"provider":"v0.2.1","sdk":"v1.14.0"}}
{
"maven": {
"sdk": "1.13.0",
"providerKt": "0.3.0",
"providerJava": "0.4.1",
"android": "0.3.2"
},
"npm": {
"core": "1.6.0",
"webSDK": "1.4.0",
"providerServer": "0.7.4",
"providerWeb": "0.2.4"
},
"pypi": {
"sdk": "0.7.4",
"provider": "0.3.0"
},
"nuget": {
"sdk": "2.2.0",
"provider": "0.2.0"
},
"go": {
"provider": "v0.2.1",
"sdk": "v1.14.0"
},
"swift": {
"provider": "v0.3.0"
}
}
Loading