Skip to content

ReforgeHQ/sdk-go

Repository files navigation

sdk-go

Go SDK for Reforge Feature Flags and Config as a Service: https://www.reforge.com

Installation

go get github.com/ReforgeHQ/sdk-go@latest

Basic example

package main

import (
	"fmt"
	"log"
	"os"

	reforge "github.com/ReforgeHQ/sdk-go"
)

func main() {
	sdkKey, exists := os.LookupEnv("REFORGE_SDK_KEY")

	if !exists {
		log.Fatal("SDK Key not found")
	}

	client, err := reforge.NewSdk(reforge.WithSdkKey(sdkKey))

	if err != nil {
		log.Fatal(err)
	}

	val, ok, err := client.GetStringValue("my.string.config", *reforge.NewContextSet())

	if err != nil {
		log.Fatal(err)
	}

	if !ok {
		log.Fatal("Value not found")
	}

	fmt.Println(val)
}

Documentation

Publishing

Automated Release Process

  1. On feature branch: Run ./scripts/prepare-release.sh v1.0.0

    • Updates internal/version.go with new version
    • Commits the version bump
  2. Create PR and merge to main

  3. Automatic: GitHub Actions will detect version change and:

    • Create git tag (e.g., v1.0.0)
    • Create GitHub release
    • Make version available: go get github.com/ReforgeHQ/sdk-go@v1.0.0

Manual Process (if needed)

  1. Bump version in internal/version.go (this is the version header clients send)
  2. Commit that change on a branch and merge into main
  3. git tag with the new version number and push that to origin

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •