admin

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 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 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, descriptors ...[]evaluator.FlagDef) *Store

NewStore creates a Store backed by the given connection pool.

func (*Store) GetAuditLog

func (s *Store) GetAuditLog(ctx context.Context, flagID string, limit int32) ([]*pbflagsv1.AuditLogEntry, error)

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

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 and per-entity killed overrides.

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

Jump to

Keyboard shortcuts

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