Documentation
¶
Index ¶
- type AdminService
- func (a *AdminService) GetAuditLog(ctx context.Context, req *connect.Request[pbflagsv1.GetAuditLogRequest]) (*connect.Response[pbflagsv1.GetAuditLogResponse], error)
- func (a *AdminService) GetFlag(ctx context.Context, req *connect.Request[pbflagsv1.GetFlagRequest]) (*connect.Response[pbflagsv1.GetFlagResponse], error)
- func (a *AdminService) GetLaunch(ctx context.Context, req *connect.Request[pbflagsv1.GetLaunchRequest]) (*connect.Response[pbflagsv1.GetLaunchResponse], error)
- func (a *AdminService) KillLaunch(ctx context.Context, req *connect.Request[pbflagsv1.KillLaunchRequest]) (*connect.Response[pbflagsv1.KillLaunchResponse], error)
- func (a *AdminService) ListFeatures(ctx context.Context, _ *connect.Request[pbflagsv1.ListFeaturesRequest]) (*connect.Response[pbflagsv1.ListFeaturesResponse], error)
- func (a *AdminService) ListLaunches(ctx context.Context, req *connect.Request[pbflagsv1.ListLaunchesRequest]) (*connect.Response[pbflagsv1.ListLaunchesResponse], error)
- func (a *AdminService) RemoveFlagOverride(_ context.Context, _ *connect.Request[pbflagsv1.RemoveFlagOverrideRequest]) (*connect.Response[pbflagsv1.RemoveFlagOverrideResponse], error)
- func (a *AdminService) SetFlagOverride(_ context.Context, _ *connect.Request[pbflagsv1.SetFlagOverrideRequest]) (*connect.Response[pbflagsv1.SetFlagOverrideResponse], error)
- func (a *AdminService) UnkillLaunch(ctx context.Context, req *connect.Request[pbflagsv1.UnkillLaunchRequest]) (*connect.Response[pbflagsv1.UnkillLaunchResponse], error)
- func (a *AdminService) UpdateFlagState(ctx context.Context, req *connect.Request[pbflagsv1.UpdateFlagStateRequest]) (*connect.Response[pbflagsv1.UpdateFlagStateResponse], error)
- func (a *AdminService) UpdateLaunchRamp(ctx context.Context, req *connect.Request[pbflagsv1.UpdateLaunchRampRequest]) (*connect.Response[pbflagsv1.UpdateLaunchRampResponse], error)
- func (a *AdminService) UpdateLaunchStatus(ctx context.Context, req *connect.Request[pbflagsv1.UpdateLaunchStatusRequest]) (*connect.Response[pbflagsv1.UpdateLaunchStatusResponse], error)
- type AuditLogFilter
- type FlagCondition
- type FlagExtra
- type Launch
- type Store
- func (s *Store) GetAuditLog(ctx context.Context, filter AuditLogFilter) ([]*pbflagsv1.AuditLogEntry, error)
- func (s *Store) GetFlag(ctx context.Context, flagID string) (*pbflagsv1.FlagDetail, *FlagExtra, error)
- func (s *Store) GetFlagState(ctx context.Context, flagID string) (*pbflagsv1.GetFlagStateResponse, error)
- func (s *Store) GetKilledFlags(ctx context.Context) (*pbflagsv1.GetKilledFlagsResponse, error)
- func (s *Store) GetLaunch(ctx context.Context, launchID string) (*Launch, error)
- func (s *Store) KillLaunch(ctx context.Context, launchID string, actor string) error
- func (s *Store) ListAllLaunches(ctx context.Context) ([]Launch, error)
- func (s *Store) ListFeatures(ctx context.Context) ([]*pbflagsv1.FeatureDetail, map[string]int, error)
- func (s *Store) ListLaunches(ctx context.Context, featureID string) ([]Launch, error)
- func (s *Store) ListLaunchesAffecting(ctx context.Context, featureID string) ([]Launch, error)
- func (s *Store) UnkillLaunch(ctx context.Context, launchID string, actor string) error
- func (s *Store) UpdateFlagState(ctx context.Context, flagID string, state pbflagsv1.State, actor string) error
- func (s *Store) UpdateLaunchRamp(ctx context.Context, launchID string, pct int, source, actor string) (prevSource string, err error)
- func (s *Store) UpdateLaunchStatus(ctx context.Context, launchID string, status string, actor string) error
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) GetAuditLog ¶
func (a *AdminService) GetAuditLog(ctx context.Context, req *connect.Request[pbflagsv1.GetAuditLogRequest]) (*connect.Response[pbflagsv1.GetAuditLogResponse], error)
func (*AdminService) GetFlag ¶
func (a *AdminService) GetFlag(ctx context.Context, req *connect.Request[pbflagsv1.GetFlagRequest]) (*connect.Response[pbflagsv1.GetFlagResponse], error)
func (*AdminService) GetLaunch ¶ added in v0.18.0
func (a *AdminService) GetLaunch(ctx context.Context, req *connect.Request[pbflagsv1.GetLaunchRequest]) (*connect.Response[pbflagsv1.GetLaunchResponse], error)
func (*AdminService) KillLaunch ¶ added in v0.18.0
func (a *AdminService) KillLaunch(ctx context.Context, req *connect.Request[pbflagsv1.KillLaunchRequest]) (*connect.Response[pbflagsv1.KillLaunchResponse], error)
func (*AdminService) ListFeatures ¶
func (a *AdminService) ListFeatures(ctx context.Context, _ *connect.Request[pbflagsv1.ListFeaturesRequest]) (*connect.Response[pbflagsv1.ListFeaturesResponse], error)
func (*AdminService) ListLaunches ¶ added in v0.18.0
func (a *AdminService) ListLaunches(ctx context.Context, req *connect.Request[pbflagsv1.ListLaunchesRequest]) (*connect.Response[pbflagsv1.ListLaunchesResponse], error)
func (*AdminService) RemoveFlagOverride ¶
func (a *AdminService) RemoveFlagOverride(_ context.Context, _ *connect.Request[pbflagsv1.RemoveFlagOverrideRequest]) (*connect.Response[pbflagsv1.RemoveFlagOverrideResponse], error)
func (*AdminService) SetFlagOverride ¶
func (a *AdminService) SetFlagOverride(_ context.Context, _ *connect.Request[pbflagsv1.SetFlagOverrideRequest]) (*connect.Response[pbflagsv1.SetFlagOverrideResponse], error)
func (*AdminService) UnkillLaunch ¶ added in v0.18.0
func (a *AdminService) UnkillLaunch(ctx context.Context, req *connect.Request[pbflagsv1.UnkillLaunchRequest]) (*connect.Response[pbflagsv1.UnkillLaunchResponse], error)
func (*AdminService) UpdateFlagState ¶
func (a *AdminService) UpdateFlagState(ctx context.Context, req *connect.Request[pbflagsv1.UpdateFlagStateRequest]) (*connect.Response[pbflagsv1.UpdateFlagStateResponse], error)
func (*AdminService) UpdateLaunchRamp ¶ added in v0.18.0
func (a *AdminService) UpdateLaunchRamp(ctx context.Context, req *connect.Request[pbflagsv1.UpdateLaunchRampRequest]) (*connect.Response[pbflagsv1.UpdateLaunchRampResponse], error)
func (*AdminService) UpdateLaunchStatus ¶ added in v0.18.0
func (a *AdminService) UpdateLaunchStatus(ctx context.Context, req *connect.Request[pbflagsv1.UpdateLaunchStatusRequest]) (*connect.Response[pbflagsv1.UpdateLaunchStatusResponse], error)
type AuditLogFilter ¶ added in v0.4.1
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 (*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 ¶
GetKilledFlags returns globally killed flag IDs.
func (*Store) KillLaunch ¶ added in v0.18.0
KillLaunch sets killed_at on a launch (reversible emergency disable).
func (*Store) ListAllLaunches ¶ added in v0.18.0
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
ListLaunches returns launches scoped to a feature (defined in the feature config).
func (*Store) ListLaunchesAffecting ¶ added in v0.18.0
ListLaunchesAffecting returns all launches that affect a feature (including cross-feature).
func (*Store) UnkillLaunch ¶ added in v0.18.0
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.