admin

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 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 FlagCondition added in v0.16.0

type FlagCondition struct {
	CEL   string // CEL expression; empty string means "otherwise" (default fallback)
	Value string // formatted display value
}

FlagCondition represents a single condition in a flag's condition chain.

type FlagExtra added in v0.16.0

type FlagExtra struct {
	Conditions      []FlagCondition
	ConditionsError string
	SyncSHA         string
}

FlagExtra holds non-proto data loaded alongside a FlagDetail.

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, *FlagExtra, error)

GetFlag returns details for a single flag.

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) ListFeatures

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

ListFeatures returns all features with their non-archived flags. The second return value maps flag_id → condition count (0 = static/default).

func (*Store) UpdateFlagState

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

UpdateFlagState sets the killed state for a flag (kill or unkill).

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