Categorygithub.com/hugokishi/go_unleash
repositorypackage
1.0.3
Repository: https://github.com/hugokishi/go_unleash.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

Package go_unleash implements the possibility to connect your app to unleash in a better way, making it possible to use mocks and interfaces.

Installation

Use go get.

go get github.com/hugokishi/go_unleash

Then import the validator package into your own code.

import "github.com/hugokishi/go_unleash"

Usage

Sample code:

package main

import (
	go_unleash "github.com/hugokishi/go_unleash"
	"github.com/hugokishi/go_unleash/internal/domain/structs"
)

func  main() {
	unClient := go_unleash.InitUnleash(
		structs.UnleashConfig{
			AppEnvironment: "YOUR_APP_ENVIRONMENT",
			AppName: "YOUR_APP_NAME",
			UnleashURL: "YOUR_UNLEASH_URL",
			UnleashAuthorizationToken: "YOUR_AUTHORIZATION_TOKEN",
			LoggingLevel: "YOUR_LOGGING_LEVEL",
		},
	)
	
	isEnabled := unClient.IsEnabled("MY_FLAG")
}

Parameters:

ParameterDescriptionValue
AppEnvironmentRefers to the environment that unleash is being configured forlocal, development, staging, production
AppNameRefers to the name that will be registered in unleashDefined by User
UnleashURLRefers to the url of connection with unleashDefined by User
UnleashAuthorizationTokenRefers to the authorization token for connecting to unleashDefined by User
LoggingLevelRefers to the logging level used in librarywarn, info, debug, error (default info)