model

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TFValueTargetingRuleSpec added in v0.2.0

func TFValueTargetingRuleSpec(v ValueTargetingRuleSpec) string

func TFValueTransformSpec added in v0.2.6

func TFValueTransformSpec(v ValueTransformSpec) string

Types

type DeleteValueRequest

type DeleteValueRequest struct {
	ID string `json:"id"`
}

type EvaluationTest added in v0.1.5

type EvaluationTest struct {
	Variables map[string]any `json:"variables"`
	Expected  string         `json:"expected"`
}

type GetValueRequest

type GetValueRequest struct {
	ID string `json:"id"`
}

type Value

type Value struct {
	ID             string            `json:"id"`
	Enabled        bool              `json:"enabled"`
	Description    string            `json:"description"`
	DefaultVariant string            `json:"defaultVariant"`
	Variants       ValueVariants     `json:"variants"`
	Targeting      ValueTargeting    `json:"targeting"`
	CreateTime     json.Number       `json:"createTime,omitempty"`
	UpdateTime     json.Number       `json:"updateTime,omitempty"`
	Tests          []*EvaluationTest `json:"tests,omitempty"`
}

type ValueBooleanValue

type ValueBooleanValue struct {
	Value bool `json:"value,omitempty"`
}

type ValueEvaluation

type ValueEvaluation struct {
	BooleanValue *ValueBooleanValue `json:"booleanValue"`
	StringValue  *ValueStringValue  `json:"stringValue"`
	JSONValue    *ValueJSONValue    `json:"jsonValue"`
	IntegerValue *ValueIntegerValue `json:"integerValue"`
}

type ValueIntegerValue added in v0.1.6

type ValueIntegerValue struct {
	Value json.Number `json:"value,omitempty"`
}

type ValueJSONValue

type ValueJSONValue struct {
	Value      map[string]any    `json:"value,omitempty"`
	Transforms []*ValueTransform `json:"transforms,omitempty"`
}

type ValueStringValue

type ValueStringValue struct {
	Value string `json:"value,omitempty"`
}

type ValueTargeting

type ValueTargeting struct {
	Rules []ValueTargetingRule `json:"rules"`
}

type ValueTargetingRule

type ValueTargetingRule struct {
	Variant string                 `json:"variant"`
	Spec    ValueTargetingRuleSpec `json:"spec"`
	Expr    string                 `json:"expr"`
}

type ValueTargetingRuleSpec

type ValueTargetingRuleSpec int32
const (
	ValueTargetingRuleSpecCEL ValueTargetingRuleSpec = iota
	ValueTargetingRuleSpecJsonLogic
)

func ValueTargetingRuleSpecFrom

func ValueTargetingRuleSpecFrom(v string) ValueTargetingRuleSpec

type ValueTransform added in v0.2.6

type ValueTransform struct {
	Spec ValueTransformSpec `json:"spec"`
	Expr string             `json:"expr"`
}

type ValueTransformSpec added in v0.2.6

type ValueTransformSpec int32
const (
	ValueTransformSpecCEL ValueTransformSpec = iota
)

func ValueTransformSpecFrom added in v0.2.6

func ValueTransformSpecFrom(v string) ValueTransformSpec

type ValueVariants

type ValueVariants map[string]ValueEvaluation

Jump to

Keyboard shortcuts

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