Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FeatureFlag ¶
type FeatureFlag struct {
// The key of a feature flag
Key string `json:"key"`
// Tell if a feature flag is enabled. If set to false,
// the feature flag can still be partially enabled thanks to
// the Users, Groups and Percentage properties
Enabled bool `json:"enabled"`
// Gives access to a feature to specific user IDs
Users []uint32 `json:"users"`
// Gives access to a feature to specific groups
Groups []string `json:"groups"`
// Gives access to a feature to a percentage of users
Percentage uint32 `json:"percentage"`
}
Represents a feature flag
func (FeatureFlag) GroupHasAccess ¶
func (f FeatureFlag) GroupHasAccess(group string) bool
Check if a group has access to a feature
func (FeatureFlag) IsEnabled ¶
func (f FeatureFlag) IsEnabled() bool
Check if a feature flag is enabled
func (FeatureFlag) IsPartiallyEnabled ¶
func (f FeatureFlag) IsPartiallyEnabled() bool
Check if a feature flag is partially enabled
func (FeatureFlag) UserHasAccess ¶
func (f FeatureFlag) UserHasAccess(user uint32) bool
Check if a user has access to a feature
func (FeatureFlag) Validate ¶
func (f FeatureFlag) Validate() error
Self validate the properties of a feature flag
type FeatureFlags ¶
type FeatureFlags []FeatureFlag
Click to show internal directories.
Click to hide internal directories.