unlaunch

package module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

README

Unlaunch Go SDK

main development Go Report Card
Build Status Build Status Go Report Card

Overview

The Unlaunch Go SDK provides a Go API to access Unlaunch feature flags and other features. Using the SDK, you can easily build Java applications that can evaluate feature flags, dynamic configurations, and more.

Getting Started

Here is a simple example.

Run go get github.com/unlaunch/go-sdk add it to your go.mod file.

package main

import (
	"fmt"
	"time"
	"github.com/unlaunch/go-sdk/unlaunchio/client"
)

func main() {
	config := client.DefaultConfig()
	factory, err := client.NewUnlaunchClientFactory("YOUR_SERVER_KEY", config)

	if err != nil {
		fmt.Printf("Error initializing Unlaunch client %s\n", err)
		return
	}

	unlaunchClient := factory.Client()
	if err = unlaunchClient.AwaitUntilReady(3 * time.Second); err != nil {
		fmt.Printf("Unlaunch Client wasn't ready %s\n", err)
	}

	variation := unlaunchClient.Variation("FLAG_KEY", "USER_ID_123", nil)

	if variation == "on" {
		// show feature
	} else {
		// don't show feature
	}
}

Build Instructions

To run all tests

go test ./...

How to Publish

Create a new tag on GitHub in the following format vx.y.z e.g. v0.0.1

Submitting issues

If you run into any problems, bugs, or have any questions or feedback, please report them using the issues feature. We'll respond to all issues usually within 24 to 48 hours.

Contributing

Please see CONTRIBUTING to find how you can contribute.

License

Licensed under the Apache License, Version 2.0. See: Apache License.

About Unlaunch

Unlaunch is a Feature Release Platform for engineering teams. Our mission is allow engineering teams of all sizes to release features safely and quickly to delight their customers. To learn more about Unlaunch, please visit unlaunch.io. You can sign up to get started for free at https://app.unlaunch.io/signup.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
unlaunchio

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL