model

package
v0.10.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	FlagNotFoundErrorCode = "FLAG_NOT_FOUND"
	ParseErrorCode        = "PARSE_ERROR"
	TypeMismatchErrorCode = "TYPE_MISMATCH"
	GeneralErrorCode      = "GENERAL"
	FlagDisabledErrorCode = "FLAG_DISABLED"
	InvalidContextCode    = "INVALID_CONTEXT"
)
View Source
const (
	TargetingMatchReason = "TARGETING_MATCH"
	SplitReason          = "SPLIT"
	DisabledReason       = "DISABLED"
	DefaultReason        = "DEFAULT"
	UnknownReason        = "UNKNOWN"
	ErrorReason          = "ERROR"
	StaticReason         = "STATIC"
)

Variables

View Source
var ReadableErrorMessage = map[string]string{
	FlagNotFoundErrorCode: "Flag not found",
	ParseErrorCode:        "Error parsing input or configuration",
	TypeMismatchErrorCode: "Type mismatch error",
	GeneralErrorCode:      "General error",
	FlagDisabledErrorCode: "Flag is disabled",
	InvalidContextCode:    "Invalid context provided",
}

Functions

func GetErrorMessage added in v0.10.0

func GetErrorMessage(code string) string

Types

type EvaluationReason

type EvaluationReason string

type Evaluators

type Evaluators struct {
	Evaluators map[string]json.RawMessage `json:"$evaluators"`
}

type Flag

type Flag struct {
	State          string                 `json:"state"`
	DefaultVariant string                 `json:"defaultVariant"`
	Variants       map[string]any         `json:"variants"`
	Targeting      json.RawMessage        `json:"targeting,omitempty"`
	Source         string                 `json:"source"`
	Selector       string                 `json:"selector"`
	Metadata       map[string]interface{} `json:"metadata,omitempty"`
}

type StateChangeNotification

type StateChangeNotification struct {
	Type    StateChangeNotificationType `json:"type"`
	Source  string                      `json:"source"`
	FlagKey string                      `json:"flagKey"`
}

type StateChangeNotificationType

type StateChangeNotificationType string
const (
	NotificationDelete StateChangeNotificationType = "delete"
	NotificationCreate StateChangeNotificationType = "write"
	NotificationUpdate StateChangeNotificationType = "update"
)

Jump to

Keyboard shortcuts

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