featurev1beta1

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

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