flagmeta

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: 1 Imported by: 0

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
}

Config holds settings for a generated flag client.

func Apply added in v0.13.0

func Apply(opts ...Option) Config

Apply builds a Config from the given options, using slog.Default() when no logger is provided.

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 FlagType

type FlagType int

FlagType identifies the underlying scalar type of a flag.

const (
	FlagTypeBool FlagType = iota
	FlagTypeString
	FlagTypeInt64
	FlagTypeDouble
)

func (FlagType) String

func (t FlagType) String() string

String returns the Go type name for the flag type.

type Option added in v0.13.0

type Option func(*Config)

Option configures a generated flag client.

func WithLogger added in v0.13.0

func WithLogger(l *slog.Logger) Option

WithLogger sets a custom logger for flag evaluation errors. By default, clients log via slog.Default().

Jump to

Keyboard shortcuts

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