Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v0.13.0
type Config struct {
Logger *slog.Logger
LogLevel slog.Level // Minimum level for evaluation logging (default: Info — suppresses Debug).
}
Config holds settings for a generated flag client.
type FlagDescriptor ¶
type FlagDescriptor struct {
ID string // Flag ID (e.g., "notifications/1").
FieldName string // Proto field name (e.g., "email_enabled").
Type FlagType // Underlying scalar type.
IsList bool // True for repeated (list-valued) flags.
// Compiled default value. Only the field matching Type (and IsList) is populated.
DefaultBool bool
DefaultString string
DefaultInt64 int64
DefaultDouble float64
DefaultBools []bool
DefaultStrings []string
DefaultInt64s []int64
DefaultDoubles []float64
}
FlagDescriptor provides structured metadata about a single flag.
type Option ¶ added in v0.13.0
type Option func(*Config)
Option configures a generated flag client.
func WithLogLevel ¶ added in v0.21.0
WithLogLevel sets the minimum log level. Use slog.LevelDebug to enable per-evaluation debug logging showing flag ID, resolved value, and source.
func WithLogger ¶ added in v0.13.0
WithLogger sets a custom logger for flag evaluation errors. By default, clients log via slog.Default().
Click to show internal directories.
Click to hide internal directories.