ff4go

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2025 License: MIT Imports: 4 Imported by: 0

README

🎛️ Feature Flag for Go

Go Report Card GitHub go.mod Go version GitHub License

Thank you for using ff4go! Feel free to report any issue of improvement 🙏

Table of contents

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FeatureFlag

type FeatureFlag struct {
	Name        string `json:"name"`
	Enabled     bool   `json:"enabled"`
	Description string `json:"description"`
	Rules       Rules  `json:"rules"`
}

type Manager

type Manager struct {
	Flags []FeatureFlag `json:"flags"`
}

func NewManager

func NewManager(data []byte) (*Manager, error)

func (*Manager) IsEnabled

func (m *Manager) IsEnabled(name string) bool

func (*Manager) IsEnabledForEnvironment

func (m *Manager) IsEnabledForEnvironment(name, environment string) bool

func (*Manager) IsEnabledForUser

func (m *Manager) IsEnabledForUser(name, user string) bool

type Rules

type Rules struct {
	Users        []string `json:"users"`
	Environments []string `json:"environments"`
	Percentage   float64  `json:"percentage"`
}

Jump to

Keyboard shortcuts

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