featureflags

package
v0.0.0-...-dd4be11 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package featureflags provides feature flag management for Weblens.

Index

Constants

View Source
const FeatureFlagCollectionKey = "featureFlags"

FeatureFlagCollectionKey is the database collection name for feature flag document(s).

View Source
const FeatureFlagDocumentID = "ff"

FeatureFlagDocumentID is the ID of the main feature flag document.

Variables

This section is empty.

Functions

func SaveFlags

func SaveFlags(ctx context.Context, ffs Bundle) error

SaveFlags saves the flags to the database and updates the cache.

Types

type Bundle

type Bundle struct {
	AllowRegistrations bool `bson:"auth.allow_registrations" json:"auth.allow_registrations"`
	EnableHDIR         bool `bson:"media.hdir_processing_enabled" json:"media.hdir_processing_enabled"`

} //	@name	Bundle

Bundle represents the application feature flag document.

func Default

func Default() Bundle

Default returns the default flags

func GetFlags

func GetFlags(ctx context.Context) (Bundle, error)

GetFlags retrieves the current flag set from cache or database.

type FlagKey

type FlagKey = string

FlagKey represents a feature flag key used to identify specific flags.

const (
	// AllowRegistrations controls whether new user registration is allowed.
	AllowRegistrations FlagKey = "auth.allow_registrations"
	// EnableHDIR controls whether HDIR (high-dynamic-range image rendering) is enabled.
	EnableHDIR FlagKey = "media.hdir_processing_enabled"
)

Feature Flag keys for Weblens settings.

Jump to

Keyboard shortcuts

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