pbflagspb

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DimensionDistribution_name = map[int32]string{
		0: "DIMENSION_DISTRIBUTION_UNSPECIFIED",
		1: "DIMENSION_DISTRIBUTION_UNIFORM",
		2: "DIMENSION_DISTRIBUTION_CATEGORICAL",
	}
	DimensionDistribution_value = map[string]int32{
		"DIMENSION_DISTRIBUTION_UNSPECIFIED": 0,
		"DIMENSION_DISTRIBUTION_UNIFORM":     1,
		"DIMENSION_DISTRIBUTION_CATEGORICAL": 2,
	}
)

Enum value maps for DimensionDistribution.

View Source
var (
	DimensionPresence_name = map[int32]string{
		0: "DIMENSION_PRESENCE_UNSPECIFIED",
		1: "DIMENSION_PRESENCE_REQUIRED",
		2: "DIMENSION_PRESENCE_OPTIONAL",
	}
	DimensionPresence_value = map[string]int32{
		"DIMENSION_PRESENCE_UNSPECIFIED": 0,
		"DIMENSION_PRESENCE_REQUIRED":    1,
		"DIMENSION_PRESENCE_OPTIONAL":    2,
	}
)

Enum value maps for DimensionPresence.

View Source
var (
	// optional pbflags.FeatureOptions feature = 51000;
	E_Feature = &file_pbflags_options_proto_extTypes[0]
	// optional pbflags.ContextOptions context = 51003;
	E_Context = &file_pbflags_options_proto_extTypes[1]
)

Extension fields to descriptorpb.MessageOptions.

View Source
var (
	// optional pbflags.FlagOptions flag = 51001;
	E_Flag = &file_pbflags_options_proto_extTypes[2]
	// optional pbflags.DimensionOptions dimension = 51004;
	E_Dimension = &file_pbflags_options_proto_extTypes[3]
)

Extension fields to descriptorpb.FieldOptions.

View Source
var (
	// repeated pbflags.ScopeOptions scope = 51005;
	E_Scope = &file_pbflags_options_proto_extTypes[4]
)

Extension fields to descriptorpb.FileOptions.

View Source
var File_pbflags_options_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type ContextOptions added in v0.15.0

type ContextOptions struct {
	// contains filtered or unexported fields
}

Applied to a message to mark it as the evaluation context. Exactly one message in the input files must carry this annotation. Each field defines a context dimension (string, enum, bool, or int64).

func (*ContextOptions) Descriptor deprecated added in v0.15.0

func (*ContextOptions) Descriptor() ([]byte, []int)

Deprecated: Use ContextOptions.ProtoReflect.Descriptor instead.

func (*ContextOptions) ProtoMessage added in v0.15.0

func (*ContextOptions) ProtoMessage()

func (*ContextOptions) ProtoReflect added in v0.15.0

func (x *ContextOptions) ProtoReflect() protoreflect.Message

func (*ContextOptions) Reset added in v0.15.0

func (x *ContextOptions) Reset()

func (*ContextOptions) String added in v0.15.0

func (x *ContextOptions) String() string

type DimensionDistribution added in v0.17.0

type DimensionDistribution int32

DimensionDistribution classifies a dimension's value distribution for cache key strategy and launch eligibility.

Wire-compatible with the old hashable bool (field 2): true (varint 1) decodes as DIMENSION_DISTRIBUTION_UNIFORM (enum value 1).

const (
	DimensionDistribution_DIMENSION_DISTRIBUTION_UNSPECIFIED DimensionDistribution = 0
	// High cardinality, stable values. Suitable for percentage-based hashing
	// (launches, experiments). E.g., user_id, session_id.
	DimensionDistribution_DIMENSION_DISTRIBUTION_UNIFORM DimensionDistribution = 1
	// Low/bounded cardinality. Enum-like. Not suitable for hashing.
	// E.g., plan_level, region. Enum and bool proto fields are inherently
	// categorical — inferred from the proto type, no annotation needed.
	DimensionDistribution_DIMENSION_DISTRIBUTION_CATEGORICAL DimensionDistribution = 2
)

func (DimensionDistribution) Descriptor added in v0.17.0

func (DimensionDistribution) Enum added in v0.17.0

func (DimensionDistribution) EnumDescriptor deprecated added in v0.17.0

func (DimensionDistribution) EnumDescriptor() ([]byte, []int)

Deprecated: Use DimensionDistribution.Descriptor instead.

func (DimensionDistribution) Number added in v0.17.0

func (DimensionDistribution) String added in v0.17.0

func (x DimensionDistribution) String() string

func (DimensionDistribution) Type added in v0.17.0

type DimensionOptions added in v0.15.0

type DimensionOptions struct {
	Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
	// Replaces the old hashable (bool, field 2) and bounded (bool, field 3).
	// Wire-compatible: old hashable: true (varint 1 on field 2) decodes as
	// DIMENSION_DISTRIBUTION_UNIFORM (enum value 1). Old bounded: true on
	// field 3 is ignored (field 3 is no longer declared).
	Distribution DimensionDistribution `protobuf:"varint,2,opt,name=distribution,proto3,enum=pbflags.DimensionDistribution" json:"distribution,omitempty"`
	// Whether this dimension is always present in evaluation contexts.
	Presence DimensionPresence `protobuf:"varint,4,opt,name=presence,proto3,enum=pbflags.DimensionPresence" json:"presence,omitempty"`
	// contains filtered or unexported fields
}

Applied to a field within the context message to define a dimension.

func (*DimensionOptions) Descriptor deprecated added in v0.15.0

func (*DimensionOptions) Descriptor() ([]byte, []int)

Deprecated: Use DimensionOptions.ProtoReflect.Descriptor instead.

func (*DimensionOptions) GetDescription added in v0.15.0

func (x *DimensionOptions) GetDescription() string

func (*DimensionOptions) GetDistribution added in v0.17.0

func (x *DimensionOptions) GetDistribution() DimensionDistribution

func (*DimensionOptions) GetPresence added in v0.17.0

func (x *DimensionOptions) GetPresence() DimensionPresence

func (*DimensionOptions) ProtoMessage added in v0.15.0

func (*DimensionOptions) ProtoMessage()

func (*DimensionOptions) ProtoReflect added in v0.15.0

func (x *DimensionOptions) ProtoReflect() protoreflect.Message

func (*DimensionOptions) Reset added in v0.15.0

func (x *DimensionOptions) Reset()

func (*DimensionOptions) String added in v0.15.0

func (x *DimensionOptions) String() string

type DimensionPresence added in v0.17.0

type DimensionPresence int32

DimensionPresence classifies whether a dimension is always set.

const (
	DimensionPresence_DIMENSION_PRESENCE_UNSPECIFIED DimensionPresence = 0
	// Always present. Consumer must set it.
	DimensionPresence_DIMENSION_PRESENCE_REQUIRED DimensionPresence = 1
	// May be absent (e.g., user_id when logged out).
	DimensionPresence_DIMENSION_PRESENCE_OPTIONAL DimensionPresence = 2
)

func (DimensionPresence) Descriptor added in v0.17.0

func (DimensionPresence) Enum added in v0.17.0

func (DimensionPresence) EnumDescriptor deprecated added in v0.17.0

func (DimensionPresence) EnumDescriptor() ([]byte, []int)

Deprecated: Use DimensionPresence.Descriptor instead.

func (DimensionPresence) Number added in v0.17.0

func (DimensionPresence) String added in v0.17.0

func (x DimensionPresence) String() string

func (DimensionPresence) Type added in v0.17.0

type FeatureOptions

type FeatureOptions struct {

	// Stable identifier for this feature. Used as the DB primary key.
	// MUST be unique across all features. MUST NOT change once set.
	// Convention: snake_case, e.g., "notifications", "billing_v2".
	Id          string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// Owner team for the feature (for UI grouping / contact).
	Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"`
	// Evaluation scopes this feature is available in. Each scope name must
	// match a (pbflags.scope) defined at file level. The codegen produces
	// feature accessor methods only on scope types listed here.
	Scopes []string `protobuf:"bytes,4,rep,name=scopes,proto3" json:"scopes,omitempty"`
	// contains filtered or unexported fields
}

Applied to a message to mark it as a feature.

func (*FeatureOptions) Descriptor deprecated

func (*FeatureOptions) Descriptor() ([]byte, []int)

Deprecated: Use FeatureOptions.ProtoReflect.Descriptor instead.

func (*FeatureOptions) GetDescription

func (x *FeatureOptions) GetDescription() string

func (*FeatureOptions) GetId

func (x *FeatureOptions) GetId() string

func (*FeatureOptions) GetOwner

func (x *FeatureOptions) GetOwner() string

func (*FeatureOptions) GetScopes added in v0.17.0

func (x *FeatureOptions) GetScopes() []string

func (*FeatureOptions) ProtoMessage

func (*FeatureOptions) ProtoMessage()

func (*FeatureOptions) ProtoReflect

func (x *FeatureOptions) ProtoReflect() protoreflect.Message

func (*FeatureOptions) Reset

func (x *FeatureOptions) Reset()

func (*FeatureOptions) String

func (x *FeatureOptions) String() string

type FlagDefault

type FlagDefault struct {

	// Types that are valid to be assigned to Value:
	//
	//	*FlagDefault_BoolValue
	//	*FlagDefault_StringValue
	//	*FlagDefault_Int64Value
	//	*FlagDefault_DoubleValue
	//	*FlagDefault_BoolListValue
	//	*FlagDefault_StringListValue
	//	*FlagDefault_Int64ListValue
	//	*FlagDefault_DoubleListValue
	Value isFlagDefault_Value `protobuf_oneof:"value"`
	// contains filtered or unexported fields
}

Uses wrapper types to distinguish "default is false/0" from "no default set." In proto3, bare bool false and int64 0 are default values and won't serialize in a oneof, making them indistinguishable from "not set."

func (*FlagDefault) Descriptor deprecated

func (*FlagDefault) Descriptor() ([]byte, []int)

Deprecated: Use FlagDefault.ProtoReflect.Descriptor instead.

func (*FlagDefault) GetBoolListValue added in v0.11.0

func (x *FlagDefault) GetBoolListValue() *FlagDefaultBoolList

func (*FlagDefault) GetBoolValue

func (x *FlagDefault) GetBoolValue() *wrapperspb.BoolValue

func (*FlagDefault) GetDoubleListValue added in v0.11.0

func (x *FlagDefault) GetDoubleListValue() *FlagDefaultDoubleList

func (*FlagDefault) GetDoubleValue

func (x *FlagDefault) GetDoubleValue() *wrapperspb.DoubleValue

func (*FlagDefault) GetInt64ListValue added in v0.11.0

func (x *FlagDefault) GetInt64ListValue() *FlagDefaultInt64List

func (*FlagDefault) GetInt64Value

func (x *FlagDefault) GetInt64Value() *wrapperspb.Int64Value

func (*FlagDefault) GetStringListValue added in v0.11.0

func (x *FlagDefault) GetStringListValue() *FlagDefaultStringList

func (*FlagDefault) GetStringValue

func (x *FlagDefault) GetStringValue() *wrapperspb.StringValue

func (*FlagDefault) GetValue

func (x *FlagDefault) GetValue() isFlagDefault_Value

func (*FlagDefault) ProtoMessage

func (*FlagDefault) ProtoMessage()

func (*FlagDefault) ProtoReflect

func (x *FlagDefault) ProtoReflect() protoreflect.Message

func (*FlagDefault) Reset

func (x *FlagDefault) Reset()

func (*FlagDefault) String

func (x *FlagDefault) String() string

type FlagDefaultBoolList added in v0.11.0

type FlagDefaultBoolList struct {
	Values []bool `protobuf:"varint,1,rep,packed,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

List wrapper messages for FlagDefault. These are structurally identical to the v1.BoolList/StringList/etc. messages but defined here to avoid an import cycle (v1/admin.proto already imports this package).

func (*FlagDefaultBoolList) Descriptor deprecated added in v0.11.0

func (*FlagDefaultBoolList) Descriptor() ([]byte, []int)

Deprecated: Use FlagDefaultBoolList.ProtoReflect.Descriptor instead.

func (*FlagDefaultBoolList) GetValues added in v0.11.0

func (x *FlagDefaultBoolList) GetValues() []bool

func (*FlagDefaultBoolList) ProtoMessage added in v0.11.0

func (*FlagDefaultBoolList) ProtoMessage()

func (*FlagDefaultBoolList) ProtoReflect added in v0.11.0

func (x *FlagDefaultBoolList) ProtoReflect() protoreflect.Message

func (*FlagDefaultBoolList) Reset added in v0.11.0

func (x *FlagDefaultBoolList) Reset()

func (*FlagDefaultBoolList) String added in v0.11.0

func (x *FlagDefaultBoolList) String() string

type FlagDefaultDoubleList added in v0.11.0

type FlagDefaultDoubleList struct {
	Values []float64 `protobuf:"fixed64,1,rep,packed,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

func (*FlagDefaultDoubleList) Descriptor deprecated added in v0.11.0

func (*FlagDefaultDoubleList) Descriptor() ([]byte, []int)

Deprecated: Use FlagDefaultDoubleList.ProtoReflect.Descriptor instead.

func (*FlagDefaultDoubleList) GetValues added in v0.11.0

func (x *FlagDefaultDoubleList) GetValues() []float64

func (*FlagDefaultDoubleList) ProtoMessage added in v0.11.0

func (*FlagDefaultDoubleList) ProtoMessage()

func (*FlagDefaultDoubleList) ProtoReflect added in v0.11.0

func (x *FlagDefaultDoubleList) ProtoReflect() protoreflect.Message

func (*FlagDefaultDoubleList) Reset added in v0.11.0

func (x *FlagDefaultDoubleList) Reset()

func (*FlagDefaultDoubleList) String added in v0.11.0

func (x *FlagDefaultDoubleList) String() string

type FlagDefaultInt64List added in v0.11.0

type FlagDefaultInt64List struct {
	Values []int64 `protobuf:"varint,1,rep,packed,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

func (*FlagDefaultInt64List) Descriptor deprecated added in v0.11.0

func (*FlagDefaultInt64List) Descriptor() ([]byte, []int)

Deprecated: Use FlagDefaultInt64List.ProtoReflect.Descriptor instead.

func (*FlagDefaultInt64List) GetValues added in v0.11.0

func (x *FlagDefaultInt64List) GetValues() []int64

func (*FlagDefaultInt64List) ProtoMessage added in v0.11.0

func (*FlagDefaultInt64List) ProtoMessage()

func (*FlagDefaultInt64List) ProtoReflect added in v0.11.0

func (x *FlagDefaultInt64List) ProtoReflect() protoreflect.Message

func (*FlagDefaultInt64List) Reset added in v0.11.0

func (x *FlagDefaultInt64List) Reset()

func (*FlagDefaultInt64List) String added in v0.11.0

func (x *FlagDefaultInt64List) String() string

type FlagDefaultStringList added in v0.11.0

type FlagDefaultStringList struct {
	Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

func (*FlagDefaultStringList) Descriptor deprecated added in v0.11.0

func (*FlagDefaultStringList) Descriptor() ([]byte, []int)

Deprecated: Use FlagDefaultStringList.ProtoReflect.Descriptor instead.

func (*FlagDefaultStringList) GetValues added in v0.11.0

func (x *FlagDefaultStringList) GetValues() []string

func (*FlagDefaultStringList) ProtoMessage added in v0.11.0

func (*FlagDefaultStringList) ProtoMessage()

func (*FlagDefaultStringList) ProtoReflect added in v0.11.0

func (x *FlagDefaultStringList) ProtoReflect() protoreflect.Message

func (*FlagDefaultStringList) Reset added in v0.11.0

func (x *FlagDefaultStringList) Reset()

func (*FlagDefaultStringList) String added in v0.11.0

func (x *FlagDefaultStringList) String() string

type FlagDefault_BoolListValue added in v0.11.0

type FlagDefault_BoolListValue struct {
	// List defaults — use types from this package to avoid import cycle
	// (v1/admin.proto imports pbflags/options.proto, so options.proto
	// cannot import v1/types.proto).
	BoolListValue *FlagDefaultBoolList `protobuf:"bytes,5,opt,name=bool_list_value,json=boolListValue,proto3,oneof"`
}

type FlagDefault_BoolValue

type FlagDefault_BoolValue struct {
	BoolValue *wrapperspb.BoolValue `protobuf:"bytes,1,opt,name=bool_value,json=boolValue,proto3,oneof"`
}

type FlagDefault_DoubleListValue added in v0.11.0

type FlagDefault_DoubleListValue struct {
	DoubleListValue *FlagDefaultDoubleList `protobuf:"bytes,8,opt,name=double_list_value,json=doubleListValue,proto3,oneof"`
}

type FlagDefault_DoubleValue

type FlagDefault_DoubleValue struct {
	DoubleValue *wrapperspb.DoubleValue `protobuf:"bytes,4,opt,name=double_value,json=doubleValue,proto3,oneof"`
}

type FlagDefault_Int64ListValue added in v0.11.0

type FlagDefault_Int64ListValue struct {
	Int64ListValue *FlagDefaultInt64List `protobuf:"bytes,7,opt,name=int64_list_value,json=int64ListValue,proto3,oneof"`
}

type FlagDefault_Int64Value

type FlagDefault_Int64Value struct {
	Int64Value *wrapperspb.Int64Value `protobuf:"bytes,3,opt,name=int64_value,json=int64Value,proto3,oneof"`
}

type FlagDefault_StringListValue added in v0.11.0

type FlagDefault_StringListValue struct {
	StringListValue *FlagDefaultStringList `protobuf:"bytes,6,opt,name=string_list_value,json=stringListValue,proto3,oneof"`
}

type FlagDefault_StringValue

type FlagDefault_StringValue struct {
	StringValue *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=string_value,json=stringValue,proto3,oneof"`
}

type FlagOptions

type FlagOptions struct {
	Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
	// Default value (type must match the field type).
	Default *FlagDefault `protobuf:"bytes,2,opt,name=default,proto3" json:"default,omitempty"`
	// Suggested values for the UI dropdown. Not enforced at evaluation time.
	// Can be overridden in the UI when setting values.
	SupportedValues *SupportedValues `protobuf:"bytes,4,opt,name=supported_values,json=supportedValues,proto3" json:"supported_values,omitempty"`
	// contains filtered or unexported fields
}

Applied to a field to mark it as a flag.

func (*FlagOptions) Descriptor deprecated

func (*FlagOptions) Descriptor() ([]byte, []int)

Deprecated: Use FlagOptions.ProtoReflect.Descriptor instead.

func (*FlagOptions) GetDefault

func (x *FlagOptions) GetDefault() *FlagDefault

func (*FlagOptions) GetDescription

func (x *FlagOptions) GetDescription() string

func (*FlagOptions) GetSupportedValues

func (x *FlagOptions) GetSupportedValues() *SupportedValues

func (*FlagOptions) ProtoMessage

func (*FlagOptions) ProtoMessage()

func (*FlagOptions) ProtoReflect

func (x *FlagOptions) ProtoReflect() protoreflect.Message

func (*FlagOptions) Reset

func (x *FlagOptions) Reset()

func (*FlagOptions) String

func (x *FlagOptions) String() string

type ScopeOptions added in v0.17.0

type ScopeOptions struct {

	// Unique name for this scope (e.g., "anon", "user", "tenant").
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Additional dimensions this scope provides beyond globally required ones.
	// Globally required dimensions (presence: REQUIRED) are implicit in every scope.
	Dimensions []string `protobuf:"bytes,2,rep,name=dimensions,proto3" json:"dimensions,omitempty"`
	// contains filtered or unexported fields
}

Scope definition. Applied as a file-level option (repeatable). Each scope defines a named execution context with a set of dimensions beyond the globally required ones.

func (*ScopeOptions) Descriptor deprecated added in v0.17.0

func (*ScopeOptions) Descriptor() ([]byte, []int)

Deprecated: Use ScopeOptions.ProtoReflect.Descriptor instead.

func (*ScopeOptions) GetDimensions added in v0.17.0

func (x *ScopeOptions) GetDimensions() []string

func (*ScopeOptions) GetName added in v0.17.0

func (x *ScopeOptions) GetName() string

func (*ScopeOptions) ProtoMessage added in v0.17.0

func (*ScopeOptions) ProtoMessage()

func (*ScopeOptions) ProtoReflect added in v0.17.0

func (x *ScopeOptions) ProtoReflect() protoreflect.Message

func (*ScopeOptions) Reset added in v0.17.0

func (x *ScopeOptions) Reset()

func (*ScopeOptions) String added in v0.17.0

func (x *ScopeOptions) String() string

type SupportedValues

type SupportedValues struct {

	// At most one of these should be populated, matching the flag's field type.
	// Validated at schema sync time (not enforced by proto structure).
	StringValues []string  `protobuf:"bytes,1,rep,name=string_values,json=stringValues,proto3" json:"string_values,omitempty"`
	Int64Values  []int64   `protobuf:"varint,2,rep,packed,name=int64_values,json=int64Values,proto3" json:"int64_values,omitempty"`
	DoubleValues []float64 `protobuf:"fixed64,3,rep,packed,name=double_values,json=doubleValues,proto3" json:"double_values,omitempty"` // (bool flags don't need supported_values — it's always true/false)
	// contains filtered or unexported fields
}

func (*SupportedValues) Descriptor deprecated

func (*SupportedValues) Descriptor() ([]byte, []int)

Deprecated: Use SupportedValues.ProtoReflect.Descriptor instead.

func (*SupportedValues) GetDoubleValues

func (x *SupportedValues) GetDoubleValues() []float64

func (*SupportedValues) GetInt64Values

func (x *SupportedValues) GetInt64Values() []int64

func (*SupportedValues) GetStringValues

func (x *SupportedValues) GetStringValues() []string

func (*SupportedValues) ProtoMessage

func (*SupportedValues) ProtoMessage()

func (*SupportedValues) ProtoReflect

func (x *SupportedValues) ProtoReflect() protoreflect.Message

func (*SupportedValues) Reset

func (x *SupportedValues) Reset()

func (*SupportedValues) String

func (x *SupportedValues) String() string

Directories

Path Synopsis
v1

Jump to

Keyboard shortcuts

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