admin

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminService

type AdminService struct {
	// contains filtered or unexported fields
}

AdminService implements the FlagAdminService Connect handler.

func NewAdminService

func NewAdminService(store *Store, logger *slog.Logger) *AdminService

NewAdminService creates a FlagAdminService handler.

type AuditLogFilter added in v0.4.1

type AuditLogFilter struct {
	FlagID string
	Action string
	Actor  string
	Limit  int32
}

AuditLogFilter specifies optional filters for audit log queries.

type BulkOverride added in v0.11.0

type BulkOverride struct {
	EntityID string
	Value    *pbflagsv1.FlagValue
}

BulkOverride represents a single entity override for batch import.

type BulkOverrideResult added in v0.11.0

type BulkOverrideResult struct {
	Created int
	Updated int
}

BulkOverrideResult reports the outcome of a batch override import.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store provides PostgreSQL persistence for flag state.

func NewStore

func NewStore(pool *pgxpool.Pool, logger *slog.Logger) *Store

NewStore creates a Store backed by the given connection pool.

func (*Store) GetAuditLog

func (s *Store) GetAuditLog(ctx context.Context, filter AuditLogFilter) ([]*pbflagsv1.AuditLogEntry, error)

GetAuditLog returns audit log entries, optionally filtered by flag ID, action, and actor.

func (*Store) GetFlag

func (s *Store) GetFlag(ctx context.Context, flagID string) (*pbflagsv1.FlagDetail, error)

GetFlag returns details for a single flag including overrides.

func (*Store) GetFlagState

func (s *Store) GetFlagState(ctx context.Context, flagID string) (*pbflagsv1.GetFlagStateResponse, error)

GetFlagState returns the state and value for a single flag.

func (*Store) GetKilledFlags

func (s *Store) GetKilledFlags(ctx context.Context) (*pbflagsv1.GetKilledFlagsResponse, error)

GetKilledFlags returns globally killed flag IDs.

func (*Store) GetOverrides

func (s *Store) GetOverrides(ctx context.Context, entityID string, flagIDs []string) (*pbflagsv1.GetOverridesResponse, error)

GetOverrides returns overrides for a specific entity.

func (*Store) ListFeatures

func (s *Store) ListFeatures(ctx context.Context) ([]*pbflagsv1.FeatureDetail, error)

ListFeatures returns all features with their non-archived flags.

func (*Store) RemoveFlagOverride

func (s *Store) RemoveFlagOverride(ctx context.Context, flagID, entityID, actor string) error

RemoveFlagOverride deletes a per-entity override.

func (*Store) SetFlagOverride

func (s *Store) SetFlagOverride(ctx context.Context, flagID, entityID string, state pbflagsv1.State, value *pbflagsv1.FlagValue, actor string) error

SetFlagOverride upserts a per-entity override.

func (*Store) SetFlagOverrides added in v0.11.0

func (s *Store) SetFlagOverrides(ctx context.Context, flagID string, overrides []BulkOverride, state pbflagsv1.State, actor string) (*BulkOverrideResult, error)

SetFlagOverrides upserts multiple per-entity overrides in a single transaction using pipelined queries. It validates the flag once, then batch-inserts all overrides and their audit log entries.

func (*Store) UpdateFlagState

func (s *Store) UpdateFlagState(ctx context.Context, flagID string, state pbflagsv1.State, value *pbflagsv1.FlagValue, actor string) error

UpdateFlagState sets the state (and optionally value) for a flag.

Directories

Path Synopsis
Package web provides an embedded admin dashboard for the pbflags feature flag system.
Package web provides an embedded admin dashboard for the pbflags feature flag system.

Jump to

Keyboard shortcuts

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