Documentation
¶
Index ¶
- Constants
- Variables
- type FeatureFlagRecord
- type Option
- type Store
- func (s *Store) Delete(ctx context.Context, key string, scopeRef gate.ScopeRef) error
- func (s *Store) GetAll(ctx context.Context, key string, chain gate.ScopeChain) ([]store.OverrideMatch, error)
- func (s *Store) Set(ctx context.Context, key string, scopeRef gate.ScopeRef, enabled bool, ...) error
- func (s *Store) Unset(ctx context.Context, key string, scopeRef gate.ScopeRef, actor gate.ActorRef) error
Constants ¶
View Source
const DefaultTable = "feature_flags"
DefaultTable is the default table name for feature flag overrides.
Variables ¶
View Source
var ErrDBRequired = ferrors.ErrStoreRequired
ErrDBRequired indicates the underlying Bun DB is missing.
View Source
var ErrInvalidKey = ferrors.ErrInvalidKey
ErrInvalidKey indicates a missing or invalid feature key.
Functions ¶
This section is empty.
Types ¶
type FeatureFlagRecord ¶
type FeatureFlagRecord struct {
bun.BaseModel `bun:"table:feature_flags"`
Key string `bun:"key,pk"`
ScopeType string `bun:"scope_type,pk"`
ScopeID string `bun:"scope_id,pk"`
Enabled *bool `bun:"enabled,nullzero"`
UpdatedBy string `bun:"updated_by,nullzero"`
UpdatedAt time.Time `bun:"updated_at,nullzero"`
}
FeatureFlagRecord maps to the feature_flags table.
type Option ¶
type Option func(*Store)
Option customizes the Bun store adapter.
func WithNowFunc ¶
WithNowFunc overrides the timestamp function used for updates.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store adapts Bun DB operations to featuregate overrides.
func (*Store) GetAll ¶ added in v0.5.0
func (s *Store) GetAll(ctx context.Context, key string, chain gate.ScopeChain) ([]store.OverrideMatch, error)
GetAll implements store.Reader.
Click to show internal directories.
Click to hide internal directories.