admin

package
v0.18.0 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.

func (*AdminService) GetLaunch added in v0.18.0

func (*AdminService) KillLaunch added in v0.18.0

func (*AdminService) ListLaunches added in v0.18.0

func (*AdminService) UnkillLaunch added in v0.18.0

func (*AdminService) UpdateLaunchRamp added in v0.18.0

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
	Comment     string // annotation from YAML comment
	LaunchID    string // launch override ID (empty if none)
	LaunchValue string // formatted launch override 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 Launch added in v0.18.0

type Launch struct {
	LaunchID         string
	ScopeFeatureID   *string // nil for cross-feature launches
	Dimension        string
	RampPct          int
	RampSource       string // "unspecified", "config", "cli", "ui"
	Status           string
	KilledAt         *time.Time
	AffectedFeatures []string
	Description      *string
	CreatedAt        time.Time
	UpdatedAt        time.Time
}

Launch represents a launch (gradual rollout) in the new schema.

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) GetLaunch added in v0.18.0

func (s *Store) GetLaunch(ctx context.Context, launchID string) (*Launch, error)

GetLaunch returns a single launch by ID.

func (*Store) KillLaunch added in v0.18.0

func (s *Store) KillLaunch(ctx context.Context, launchID string, actor string) error

KillLaunch sets killed_at on a launch (reversible emergency disable).

func (*Store) ListAllLaunches added in v0.18.0

func (s *Store) ListAllLaunches(ctx context.Context) ([]Launch, error)

ListAllLaunches returns all launches.

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) ListLaunches added in v0.18.0

func (s *Store) ListLaunches(ctx context.Context, featureID string) ([]Launch, error)

ListLaunches returns launches scoped to a feature (defined in the feature config).

func (*Store) ListLaunchesAffecting added in v0.18.0

func (s *Store) ListLaunchesAffecting(ctx context.Context, featureID string) ([]Launch, error)

ListLaunchesAffecting returns all launches that affect a feature (including cross-feature).

func (*Store) UnkillLaunch added in v0.18.0

func (s *Store) UnkillLaunch(ctx context.Context, launchID string, actor string) error

UnkillLaunch clears killed_at on a launch (resume where it left off).

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

func (*Store) UpdateLaunchRamp added in v0.18.0

func (s *Store) UpdateLaunchRamp(ctx context.Context, launchID string, pct int, source, actor string) (prevSource string, err error)

UpdateLaunchRamp changes the ramp percentage for a launch and records an audit log entry. Returns the previous ramp_source so callers can warn when overriding config-managed ramp.

func (*Store) UpdateLaunchStatus added in v0.18.0

func (s *Store) UpdateLaunchStatus(ctx context.Context, launchID string, status string, actor string) error

UpdateLaunchStatus changes the lifecycle status of a launch.

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