examplepb

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PlanLevel_name = map[int32]string{
		0: "PLAN_LEVEL_UNSPECIFIED",
		1: "PLAN_LEVEL_FREE",
		2: "PLAN_LEVEL_PRO",
		3: "PLAN_LEVEL_ENTERPRISE",
	}
	PlanLevel_value = map[string]int32{
		"PLAN_LEVEL_UNSPECIFIED": 0,
		"PLAN_LEVEL_FREE":        1,
		"PLAN_LEVEL_PRO":         2,
		"PLAN_LEVEL_ENTERPRISE":  3,
	}
)

Enum value maps for PlanLevel.

View Source
var (
	DeviceType_name = map[int32]string{
		0: "DEVICE_TYPE_UNSPECIFIED",
		1: "DEVICE_TYPE_DESKTOP",
		2: "DEVICE_TYPE_MOBILE",
		3: "DEVICE_TYPE_TABLET",
	}
	DeviceType_value = map[string]int32{
		"DEVICE_TYPE_UNSPECIFIED": 0,
		"DEVICE_TYPE_DESKTOP":     1,
		"DEVICE_TYPE_MOBILE":      2,
		"DEVICE_TYPE_TABLET":      3,
	}
)

Enum value maps for DeviceType.

View Source
var File_example_notifications_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type DeviceType added in v0.15.0

type DeviceType int32
const (
	DeviceType_DEVICE_TYPE_UNSPECIFIED DeviceType = 0
	DeviceType_DEVICE_TYPE_DESKTOP     DeviceType = 1
	DeviceType_DEVICE_TYPE_MOBILE      DeviceType = 2
	DeviceType_DEVICE_TYPE_TABLET      DeviceType = 3
)

func (DeviceType) Descriptor added in v0.15.0

func (DeviceType) Descriptor() protoreflect.EnumDescriptor

func (DeviceType) Enum added in v0.15.0

func (x DeviceType) Enum() *DeviceType

func (DeviceType) EnumDescriptor deprecated added in v0.15.0

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

Deprecated: Use DeviceType.Descriptor instead.

func (DeviceType) Number added in v0.15.0

func (x DeviceType) Number() protoreflect.EnumNumber

func (DeviceType) String added in v0.15.0

func (x DeviceType) String() string

func (DeviceType) Type added in v0.15.0

type EvaluationContext added in v0.15.0

type EvaluationContext struct {

	// String dimensions — identifiers with unbounded cardinality.
	UserId    string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	// Enum dimensions — bounded cardinality, compile-time safe constructors.
	Plan       PlanLevel  `protobuf:"varint,3,opt,name=plan,proto3,enum=example.PlanLevel" json:"plan,omitempty"`
	DeviceType DeviceType `protobuf:"varint,4,opt,name=device_type,json=deviceType,proto3,enum=example.DeviceType" json:"device_type,omitempty"`
	// Bool dimension.
	IsInternal bool `protobuf:"varint,5,opt,name=is_internal,json=isInternal,proto3" json:"is_internal,omitempty"`
	// contains filtered or unexported fields
}

EvaluationContext defines the typed dimensions available for flag conditions. Exactly one message in the input files must carry the (pbflags.context) option.

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

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

Deprecated: Use EvaluationContext.ProtoReflect.Descriptor instead.

func (*EvaluationContext) GetDeviceType added in v0.15.0

func (x *EvaluationContext) GetDeviceType() DeviceType

func (*EvaluationContext) GetIsInternal added in v0.15.0

func (x *EvaluationContext) GetIsInternal() bool

func (*EvaluationContext) GetPlan added in v0.15.0

func (x *EvaluationContext) GetPlan() PlanLevel

func (*EvaluationContext) GetSessionId added in v0.15.0

func (x *EvaluationContext) GetSessionId() string

func (*EvaluationContext) GetUserId added in v0.15.0

func (x *EvaluationContext) GetUserId() string

func (*EvaluationContext) ProtoMessage added in v0.15.0

func (*EvaluationContext) ProtoMessage()

func (*EvaluationContext) ProtoReflect added in v0.15.0

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

func (*EvaluationContext) Reset added in v0.15.0

func (x *EvaluationContext) Reset()

func (*EvaluationContext) String added in v0.15.0

func (x *EvaluationContext) String() string

type Notifications

type Notifications struct {

	// Enable email notifications.
	EmailEnabled bool `protobuf:"varint,1,opt,name=email_enabled,json=emailEnabled,proto3" json:"email_enabled,omitempty"`
	// How often to send digest emails.
	DigestFrequency string `protobuf:"bytes,2,opt,name=digest_frequency,json=digestFrequency,proto3" json:"digest_frequency,omitempty"`
	// Maximum retry attempts for notification delivery.
	MaxRetries int64 `protobuf:"varint,3,opt,name=max_retries,json=maxRetries,proto3" json:"max_retries,omitempty"`
	// Minimum score threshold for triggering notifications.
	ScoreThreshold float64 `protobuf:"fixed64,4,opt,name=score_threshold,json=scoreThreshold,proto3" json:"score_threshold,omitempty"`
	// Email addresses for incident notifications.
	NotificationEmails []string `protobuf:"bytes,5,rep,name=notification_emails,json=notificationEmails,proto3" json:"notification_emails,omitempty"`
	// Retry delay intervals in seconds.
	RetryDelays []int64 `protobuf:"varint,6,rep,packed,name=retry_delays,json=retryDelays,proto3" json:"retry_delays,omitempty"`
	// contains filtered or unexported fields
}

Notifications demonstrates how to define a feature with multiple flags. Each field annotated with (pbflags.flag) becomes a runtime-configurable flag.

func (*Notifications) Descriptor deprecated

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

Deprecated: Use Notifications.ProtoReflect.Descriptor instead.

func (*Notifications) GetDigestFrequency

func (x *Notifications) GetDigestFrequency() string

func (*Notifications) GetEmailEnabled

func (x *Notifications) GetEmailEnabled() bool

func (*Notifications) GetMaxRetries

func (x *Notifications) GetMaxRetries() int64

func (*Notifications) GetNotificationEmails added in v0.11.0

func (x *Notifications) GetNotificationEmails() []string

func (*Notifications) GetRetryDelays added in v0.11.0

func (x *Notifications) GetRetryDelays() []int64

func (*Notifications) GetScoreThreshold

func (x *Notifications) GetScoreThreshold() float64

func (*Notifications) ProtoMessage

func (*Notifications) ProtoMessage()

func (*Notifications) ProtoReflect

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

func (*Notifications) Reset

func (x *Notifications) Reset()

func (*Notifications) String

func (x *Notifications) String() string

type PlanLevel added in v0.15.0

type PlanLevel int32

Enum dimensions get typed constructors and sync-time value validation.

const (
	PlanLevel_PLAN_LEVEL_UNSPECIFIED PlanLevel = 0
	PlanLevel_PLAN_LEVEL_FREE        PlanLevel = 1
	PlanLevel_PLAN_LEVEL_PRO         PlanLevel = 2
	PlanLevel_PLAN_LEVEL_ENTERPRISE  PlanLevel = 3
)

func (PlanLevel) Descriptor added in v0.15.0

func (PlanLevel) Descriptor() protoreflect.EnumDescriptor

func (PlanLevel) Enum added in v0.15.0

func (x PlanLevel) Enum() *PlanLevel

func (PlanLevel) EnumDescriptor deprecated added in v0.15.0

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

Deprecated: Use PlanLevel.Descriptor instead.

func (PlanLevel) Number added in v0.15.0

func (x PlanLevel) Number() protoreflect.EnumNumber

func (PlanLevel) String added in v0.15.0

func (x PlanLevel) String() string

func (PlanLevel) Type added in v0.15.0

Jump to

Keyboard shortcuts

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