pbflagspb

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Layer_name = map[int32]string{
		0: "LAYER_UNSPECIFIED",
		1: "LAYER_GLOBAL",
		2: "LAYER_USER",
	}
	Layer_value = map[string]int32{
		"LAYER_UNSPECIFIED": 0,
		"LAYER_GLOBAL":      1,
		"LAYER_USER":        2,
	}
)

Enum value maps for Layer.

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

Extension fields to descriptorpb.MessageOptions.

View Source
var (
	// optional pbflags.FlagOptions flag = 51001;
	E_Flag = &file_pbflags_options_proto_extTypes[1]
)

Extension fields to descriptorpb.FieldOptions.

View Source
var File_pbflags_options_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

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"`
	// 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) 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
	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) GetBoolValue

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

func (*FlagDefault) GetDoubleValue

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

func (*FlagDefault) GetInt64Value

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

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 FlagDefault_BoolValue

type FlagDefault_BoolValue struct {
	BoolValue *wrapperspb.BoolValue `protobuf:"bytes,1,opt,name=bool_value,json=boolValue,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_Int64Value

type FlagDefault_Int64Value struct {
	Int64Value *wrapperspb.Int64Value `protobuf:"bytes,3,opt,name=int64_value,json=int64Value,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"`
	// Which layer this flag varies by. Treated as GLOBAL if unset.
	// Note: proto3 will yield LAYER_UNSPECIFIED (0) when not set.
	// Schema sync and evaluation MUST treat UNSPECIFIED as GLOBAL.
	Layer Layer `protobuf:"varint,3,opt,name=layer,proto3,enum=pbflags.Layer" json:"layer,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) GetLayer

func (x *FlagOptions) GetLayer() Layer

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 Layer

type Layer int32
const (
	Layer_LAYER_UNSPECIFIED Layer = 0 // Treated as GLOBAL by schema sync and evaluation.
	Layer_LAYER_GLOBAL      Layer = 1
	Layer_LAYER_USER        Layer = 2
)

func (Layer) Descriptor

func (Layer) Descriptor() protoreflect.EnumDescriptor

func (Layer) Enum

func (x Layer) Enum() *Layer

func (Layer) EnumDescriptor deprecated

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

Deprecated: Use Layer.Descriptor instead.

func (Layer) Number

func (x Layer) Number() protoreflect.EnumNumber

func (Layer) String

func (x Layer) String() string

func (Layer) Type

func (Layer) Type() protoreflect.EnumType

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