featurev1beta1

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FeatureType_name = map[int32]string{
		0: "FEATURE_TYPE_UNSPECIFIED",
		1: "FEATURE_TYPE_BOOL",
		2: "FEATURE_TYPE_INT",
		3: "FEATURE_TYPE_FLOAT",
		4: "FEATURE_TYPE_STRING",
		5: "FEATURE_TYPE_JSON",
		6: "FEATURE_TYPE_PROTO",
	}
	FeatureType_value = map[string]int32{
		"FEATURE_TYPE_UNSPECIFIED": 0,
		"FEATURE_TYPE_BOOL":        1,
		"FEATURE_TYPE_INT":         2,
		"FEATURE_TYPE_FLOAT":       3,
		"FEATURE_TYPE_STRING":      4,
		"FEATURE_TYPE_JSON":        5,
		"FEATURE_TYPE_PROTO":       6,
	}
)

Enum value maps for FeatureType.

View Source
var File_lekko_feature_v1beta1_feature_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Constraint

type Constraint struct {

	// RulesLang string. All edits to ruleslang will be made to
	// this string for now, and the ast will be derived from it.
	Rule string `protobuf:"bytes,1,opt,name=rule,proto3" json:"rule,omitempty"`
	// This can be empty. If non-empty, and the above rule evaluated to true,
	// then the rules engine should set its return value to this value.
	Value *anypb.Any `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// If this list is empty, or none of the rules pass,
	// return the most recent concrete value we traversed.
	Constraints []*Constraint `protobuf:"bytes,3,rep,name=constraints,proto3" json:"constraints,omitempty"`
	// Rules AST used for rules evaluation. It is a strict derivative of the
	// string rule above.
	RuleAst *v1beta2.Rule `protobuf:"bytes,4,opt,name=rule_ast,json=ruleAst,proto3" json:"rule_ast,omitempty"`
	// Rules AST used for rules evaluation. It is an n-ary tree.
	RuleAstNew *v1beta3.Rule `protobuf:"bytes,5,opt,name=rule_ast_new,json=ruleAstNew,proto3" json:"rule_ast_new,omitempty"`
	// contains filtered or unexported fields
}

func (*Constraint) Descriptor deprecated

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

Deprecated: Use Constraint.ProtoReflect.Descriptor instead.

func (*Constraint) GetConstraints

func (x *Constraint) GetConstraints() []*Constraint

func (*Constraint) GetRule

func (x *Constraint) GetRule() string

func (*Constraint) GetRuleAst

func (x *Constraint) GetRuleAst() *v1beta2.Rule

func (*Constraint) GetRuleAstNew added in v0.2.8

func (x *Constraint) GetRuleAstNew() *v1beta3.Rule

func (*Constraint) GetValue

func (x *Constraint) GetValue() *anypb.Any

func (*Constraint) ProtoMessage

func (*Constraint) ProtoMessage()

func (*Constraint) ProtoReflect

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

func (*Constraint) Reset

func (x *Constraint) Reset()

func (*Constraint) String

func (x *Constraint) String() string

type Feature

type Feature struct {
	Key         string      `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Description string      `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	Tree        *Tree       `protobuf:"bytes,3,opt,name=tree,proto3" json:"tree,omitempty"`
	Type        FeatureType `protobuf:"varint,4,opt,name=type,proto3,enum=lekko.feature.v1beta1.FeatureType" json:"type,omitempty"`
	// contains filtered or unexported fields
}

A prototype of the wrapper type that will be used to house all feature flags for the 'homegrown' feature flagging solution: User-defined proto defintions, and a tree-based constraints system. A real-life example of this in practice is visualized here: https://lucid.app/lucidchart/f735298f-db2c-4207-8d14-28b375a25871/edit?view_items=bV8G0U69AJNc&invitationId=inv_d057a3b1-21d6-4290-9aea-5eb1c556a8ef#

func (*Feature) Descriptor deprecated

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

Deprecated: Use Feature.ProtoReflect.Descriptor instead.

func (*Feature) GetDescription

func (x *Feature) GetDescription() string

func (*Feature) GetKey

func (x *Feature) GetKey() string

func (*Feature) GetTree

func (x *Feature) GetTree() *Tree

func (*Feature) GetType added in v0.2.6

func (x *Feature) GetType() FeatureType

func (*Feature) ProtoMessage

func (*Feature) ProtoMessage()

func (*Feature) ProtoReflect

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

func (*Feature) Reset

func (x *Feature) Reset()

func (*Feature) String

func (x *Feature) String() string

type FeatureType added in v0.2.6

type FeatureType int32

Enumerates the canonical types that lekko supports

const (
	FeatureType_FEATURE_TYPE_UNSPECIFIED FeatureType = 0
	FeatureType_FEATURE_TYPE_BOOL        FeatureType = 1
	FeatureType_FEATURE_TYPE_INT         FeatureType = 2
	FeatureType_FEATURE_TYPE_FLOAT       FeatureType = 3
	FeatureType_FEATURE_TYPE_STRING      FeatureType = 4
	FeatureType_FEATURE_TYPE_JSON        FeatureType = 5
	FeatureType_FEATURE_TYPE_PROTO       FeatureType = 6
)

func (FeatureType) Descriptor added in v0.2.6

func (FeatureType) Enum added in v0.2.6

func (x FeatureType) Enum() *FeatureType

func (FeatureType) EnumDescriptor deprecated added in v0.2.6

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

Deprecated: Use FeatureType.Descriptor instead.

func (FeatureType) Number added in v0.2.6

func (x FeatureType) Number() protoreflect.EnumNumber

func (FeatureType) String added in v0.2.6

func (x FeatureType) String() string

func (FeatureType) Type added in v0.2.6

type Tree

type Tree struct {

	// The default value to fall back to. If there are no constraints/rules
	// defined, this is what gets returned.
	Default     *anypb.Any    `protobuf:"bytes,1,opt,name=default,proto3" json:"default,omitempty"`
	Constraints []*Constraint `protobuf:"bytes,2,rep,name=constraints,proto3" json:"constraints,omitempty"`
	// contains filtered or unexported fields
}

When the rules evaluator is traversing the tree, it will keep a local variable 'value' that is updated along the way and is finally returned. It is initially set to the default value of the root node.

func (*Tree) Descriptor deprecated

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

Deprecated: Use Tree.ProtoReflect.Descriptor instead.

func (*Tree) GetConstraints

func (x *Tree) GetConstraints() []*Constraint

func (*Tree) GetDefault

func (x *Tree) GetDefault() *anypb.Any

func (*Tree) ProtoMessage

func (*Tree) ProtoMessage()

func (*Tree) ProtoReflect

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

func (*Tree) Reset

func (x *Tree) Reset()

func (*Tree) String

func (x *Tree) String() string

Jump to

Keyboard shortcuts

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