ext

package
v1.25.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Constraint

type Constraint struct {
	Type        string `yaml:"type,omitempty"`
	Property    string `yaml:"property,omitempty"`
	Operator    string `yaml:"operator,omitempty"`
	Value       string `yaml:"value,omitempty"`
	Description string `yaml:"description,omitempty"`
}

type Distribution

type Distribution struct {
	VariantKey string  `yaml:"variant,omitempty"`
	Rollout    float32 `yaml:"rollout,omitempty"`
}

type Document

type Document struct {
	Version   string     `yaml:"version,omitempty"`
	Namespace string     `yaml:"namespace,omitempty"`
	Flags     []*Flag    `yaml:"flags,omitempty"`
	Segments  []*Segment `yaml:"segments,omitempty"`
}

type Exporter

type Exporter struct {
	// contains filtered or unexported fields
}

func NewExporter

func NewExporter(store Lister, namespace string) *Exporter

func (*Exporter) Export

func (e *Exporter) Export(ctx context.Context, w io.Writer) error

type Flag

type Flag struct {
	Key         string     `yaml:"key,omitempty"`
	Name        string     `yaml:"name,omitempty"`
	Type        string     `yaml:"type,omitempty"`
	Description string     `yaml:"description,omitempty"`
	Enabled     bool       `yaml:"enabled"`
	Variants    []*Variant `yaml:"variants,omitempty"`
	Rules       []*Rule    `yaml:"rules,omitempty"`
	Rollouts    []*Rollout `yaml:"rollouts,omitempty"`
}

type ImportOpt added in v1.23.0

type ImportOpt func(*Importer)

func WithCreateNamespace added in v1.23.0

func WithCreateNamespace() ImportOpt

func WithNamespace added in v1.23.0

func WithNamespace(ns string) ImportOpt

type Importer

type Importer struct {
	// contains filtered or unexported fields
}

func NewImporter

func NewImporter(store Creator, opts ...ImportOpt) *Importer

func (*Importer) Import

func (i *Importer) Import(ctx context.Context, r io.Reader) (err error)

type IsSegment added in v1.25.0

type IsSegment interface {
	IsSegment()
}

IsSegment is used to unify the two types of segments that can come in from the import.

type Lister added in v1.20.0

type Rollout added in v1.24.0

type Rollout struct {
	Description string         `yaml:"description,omitempty"`
	Segment     *SegmentRule   `yaml:"segment,omitempty"`
	Threshold   *ThresholdRule `yaml:"threshold,omitempty"`
}

type Rule

type Rule struct {
	Segment       *SegmentEmbed   `yaml:"segment,omitempty"`
	Rank          uint            `yaml:"rank,omitempty"`
	Distributions []*Distribution `yaml:"distributions,omitempty"`
}

type Segment

type Segment struct {
	Key         string        `yaml:"key,omitempty"`
	Name        string        `yaml:"name,omitempty"`
	Description string        `yaml:"description,omitempty"`
	Constraints []*Constraint `yaml:"constraints,omitempty"`
	MatchType   string        `yaml:"match_type,omitempty"`
}

type SegmentEmbed added in v1.25.0

type SegmentEmbed struct {
	IsSegment `yaml:"-"`
}

func (*SegmentEmbed) MarshalYAML added in v1.25.0

func (s *SegmentEmbed) MarshalYAML() (interface{}, error)

MarshalYAML tries to type assert to either of the following types that implement IsSegment, and returns the marshaled value.

func (*SegmentEmbed) UnmarshalYAML added in v1.25.0

func (s *SegmentEmbed) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML attempts to unmarshal a string or `SegmentKeys`, and fails if it can not do so.

type SegmentKey added in v1.25.0

type SegmentKey string

func (SegmentKey) IsSegment added in v1.25.0

func (s SegmentKey) IsSegment()

type SegmentRule added in v1.24.0

type SegmentRule struct {
	Key      string   `yaml:"key,omitempty"`
	Keys     []string `yaml:"keys,omitempty"`
	Operator string   `yaml:"operator,omitempty"`
	Value    bool     `yaml:"value,omitempty"`
}

type Segments added in v1.25.0

type Segments struct {
	Keys            []string `yaml:"keys,omitempty"`
	SegmentOperator string   `yaml:"operator,omitempty"`
}

func (*Segments) IsSegment added in v1.25.0

func (s *Segments) IsSegment()

type ThresholdRule added in v1.24.0

type ThresholdRule struct {
	Percentage float32 `yaml:"percentage,omitempty"`
	Value      bool    `yaml:"value,omitempty"`
}

type Variant

type Variant struct {
	Key         string      `yaml:"key,omitempty"`
	Name        string      `yaml:"name,omitempty"`
	Description string      `yaml:"description,omitempty"`
	Attachment  interface{} `yaml:"attachment,omitempty"`
}

Jump to

Keyboard shortcuts

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