wireconfig

package
v8.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package wireconfig holds types and constants that define the representation of the ConfigCat configuration as transmitted over the wire from the ConfigCat CDN.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	VariationID     string            `json:"i"`
	Value           interface{}       `json:"v"`
	Type            EntryType         `json:"t"`
	RolloutRules    []*RolloutRule    `json:"r"`
	PercentageRules []*PercentageRule `json:"p"`

	ValueID int32 `json:"-"`
}

type EntryType

type EntryType int
const (
	BoolEntry   EntryType = 0
	StringEntry EntryType = 1
	IntEntry    EntryType = 2
	FloatEntry  EntryType = 3
)

type Operator

type Operator int
const (
	OpOneOf             Operator = 0
	OpNotOneOf          Operator = 1
	OpContains          Operator = 2
	OpNotContains       Operator = 3
	OpOneOfSemver       Operator = 4
	OpNotOneOfSemver    Operator = 5
	OpLessSemver        Operator = 6
	OpLessEqSemver      Operator = 7
	OpGreaterSemver     Operator = 8
	OpGreaterEqSemver   Operator = 9
	OpEqNum             Operator = 10
	OpNotEqNum          Operator = 11
	OpLessNum           Operator = 12
	OpLessEqNum         Operator = 13
	OpGreaterNum        Operator = 14
	OpGreaterEqNum      Operator = 15
	OpOneOfSensitive    Operator = 16
	OpNotOneOfSensitive Operator = 17
)

func (Operator) String

func (op Operator) String() string

type PercentageRule

type PercentageRule struct {
	VariationID string      `json:"i"`
	Value       interface{} `json:"v"`
	Percentage  int64       `json:"p"`

	ValueID int32 `json:"-"`
}

type Preferences

type Preferences struct {
	URL      string           `json:"u"`
	Redirect *RedirectionKind `json:"r"` // NoRedirect, ShouldRedirect or ForceRedirect
}

type RedirectionKind

type RedirectionKind int
const (
	// Nodirect indicates that the configuration is available
	// in this request, but that the next request should be
	// made to the redirected address.
	Nodirect RedirectionKind = 0

	// ShouldRedirect indicates that there is no configuration
	// available at this address, and that the client should
	// redirect immediately. This does not take effect when
	// talking to a custom URL.
	ShouldRedirect RedirectionKind = 1

	// ForceRedirect indicates that there is no configuration
	// available at this address, and that the client should redirect
	// immediately even when talking to a custom URL.
	ForceRedirect RedirectionKind = 2
)

type RolloutRule

type RolloutRule struct {
	VariationID         string      `json:"i"`
	Value               interface{} `json:"v"`
	ComparisonAttribute string      `json:"a"`
	ComparisonValue     string      `json:"c"`
	Comparator          Operator    `json:"t"`

	ValueID int32 `json:"-"`
}

type RootNode

type RootNode struct {
	Entries     map[string]*Entry `json:"f"`
	Preferences *Preferences      `json:"p"`
}

type SimplifiedConfig

type SimplifiedConfig struct {
	Flags map[string]interface{} `json:"flags"`
}

Jump to

Keyboard shortcuts

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