Documentation ¶
Index ¶
- Variables
- type Constraint
- type Creator
- type Decoder
- type Distribution
- type Document
- type EncodeCloser
- type Encoder
- type Encoding
- type Exporter
- type Flag
- type ImportOpt
- type Importer
- type IsNamespace
- type IsSegment
- type Lister
- type Namespace
- type NamespaceEmbed
- type NamespaceKey
- type NopCloseEncoder
- type Rollout
- type Rule
- type Segment
- type SegmentEmbed
- type SegmentKey
- type SegmentRule
- type Segments
- type ThresholdRule
- type Variant
Constants ¶
This section is empty.
Variables ¶
var DefaultNamespace = &NamespaceEmbed{&Namespace{Key: "default", Name: "Default"}}
Functions ¶
This section is empty.
Types ¶
type Constraint ¶
type Constraint struct { Type string `yaml:"type,omitempty" json:"type,omitempty"` Property string `yaml:"property,omitempty" json:"property,omitempty"` Operator string `yaml:"operator,omitempty" json:"operator,omitempty"` Value string `yaml:"value,omitempty" json:"value,omitempty"` Description string `yaml:"description,omitempty" json:"description,omitempty"` }
type Creator ¶ added in v1.20.0
type Creator interface { GetNamespace(context.Context, *flipt.GetNamespaceRequest) (*flipt.Namespace, error) CreateNamespace(context.Context, *flipt.CreateNamespaceRequest) (*flipt.Namespace, error) CreateFlag(context.Context, *flipt.CreateFlagRequest) (*flipt.Flag, error) UpdateFlag(context.Context, *flipt.UpdateFlagRequest) (*flipt.Flag, error) CreateVariant(context.Context, *flipt.CreateVariantRequest) (*flipt.Variant, error) CreateSegment(context.Context, *flipt.CreateSegmentRequest) (*flipt.Segment, error) CreateConstraint(context.Context, *flipt.CreateConstraintRequest) (*flipt.Constraint, error) CreateRule(context.Context, *flipt.CreateRuleRequest) (*flipt.Rule, error) CreateDistribution(context.Context, *flipt.CreateDistributionRequest) (*flipt.Distribution, error) CreateRollout(context.Context, *flipt.CreateRolloutRequest) (*flipt.Rollout, error) ListFlags(ctx context.Context, v *flipt.ListFlagRequest) (*flipt.FlagList, error) ListSegments(ctx context.Context, v *flipt.ListSegmentRequest) (*flipt.SegmentList, error) }
type Distribution ¶
type Document ¶
type Document struct { Version string `yaml:"version,omitempty" json:"version,omitempty"` Namespace *NamespaceEmbed `yaml:"namespace,omitempty" json:"namespace,omitempty"` Flags []*Flag `yaml:"flags,omitempty" json:"flags,omitempty"` Segments []*Segment `yaml:"segments,omitempty" json:"segments,omitempty"` Etag string `yaml:"-" json:"-"` }
type EncodeCloser ¶ added in v1.31.0
type Encoding ¶ added in v1.31.0
type Encoding string
func (Encoding) NewEncoder ¶ added in v1.31.0
func (e Encoding) NewEncoder(w io.Writer) EncodeCloser
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
func NewExporter ¶
type Flag ¶
type Flag struct { Key string `yaml:"key,omitempty" json:"key,omitempty"` Name string `yaml:"name,omitempty" json:"name,omitempty"` Type string `yaml:"type,omitempty" json:"type,omitempty"` Description string `yaml:"description,omitempty" json:"description,omitempty"` Enabled bool `yaml:"enabled" json:"enabled"` Metadata map[string]any `yaml:"metadata,omitempty" json:"metadata,omitempty"` Variants []*Variant `yaml:"variants,omitempty" json:"variants,omitempty"` Rules []*Rule `yaml:"rules,omitempty" json:"rules,omitempty"` Rollouts []*Rollout `yaml:"rollouts,omitempty" json:"rollouts,omitempty"` }
type Importer ¶
type Importer struct {
// contains filtered or unexported fields
}
func NewImporter ¶
type IsNamespace ¶ added in v1.48.0
type IsNamespace interface { IsNamespace() GetKey() string }
IsNamespace is used to unify the two types of namespaces that can come in from the import.
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 Lister interface { GetNamespace(context.Context, *flipt.GetNamespaceRequest) (*flipt.Namespace, error) ListNamespaces(context.Context, *flipt.ListNamespaceRequest) (*flipt.NamespaceList, error) ListFlags(context.Context, *flipt.ListFlagRequest) (*flipt.FlagList, error) ListSegments(context.Context, *flipt.ListSegmentRequest) (*flipt.SegmentList, error) ListRules(context.Context, *flipt.ListRuleRequest) (*flipt.RuleList, error) ListRollouts(context.Context, *flipt.ListRolloutRequest) (*flipt.RolloutList, error) }
type Namespace ¶ added in v1.48.0
type Namespace struct { Key string `yaml:"key,omitempty" json:"key,omitempty"` Name string `yaml:"name,omitempty" json:"name,omitempty"` Description string `yaml:"description,omitempty" json:"description,omitempty"` }
func (*Namespace) IsNamespace ¶ added in v1.48.0
func (n *Namespace) IsNamespace()
type NamespaceEmbed ¶ added in v1.48.0
type NamespaceEmbed struct {
IsNamespace `yaml:"-"`
}
func (*NamespaceEmbed) MarshalJSON ¶ added in v1.48.0
func (n *NamespaceEmbed) MarshalJSON() ([]byte, error)
MarshalJSON tries to type assert to either of the following types that implement IsNamespace, and returns the marshaled value.
func (*NamespaceEmbed) MarshalYAML ¶ added in v1.48.0
func (n *NamespaceEmbed) MarshalYAML() (interface{}, error)
MarshalYAML tries to type assert to either of the following types that implement IsNamespace, and returns the marshaled value.
func (*NamespaceEmbed) String ¶ added in v1.48.0
func (n *NamespaceEmbed) String() string
func (*NamespaceEmbed) UnmarshalJSON ¶ added in v1.48.0
func (n *NamespaceEmbed) UnmarshalJSON(v []byte) error
UnmarshalJSON attempts to unmarshal a string or `Namespace`, and fails if it can not do so.
func (*NamespaceEmbed) UnmarshalYAML ¶ added in v1.48.0
func (n *NamespaceEmbed) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML attempts to unmarshal a string or `Namespace`, and fails if it can not do so.
type NamespaceKey ¶ added in v1.48.0
type NamespaceKey string
func (NamespaceKey) GetKey ¶ added in v1.48.0
func (n NamespaceKey) GetKey() string
func (NamespaceKey) IsNamespace ¶ added in v1.48.0
func (n NamespaceKey) IsNamespace()
type NopCloseEncoder ¶ added in v1.31.0
type NopCloseEncoder struct {
Encoder
}
func (NopCloseEncoder) Close ¶ added in v1.31.0
func (n NopCloseEncoder) Close() error
type Rollout ¶ added in v1.24.0
type Rollout struct { Description string `yaml:"description,omitempty" json:"description,omitempty"` Segment *SegmentRule `yaml:"segment,omitempty" json:"segment,omitempty"` Threshold *ThresholdRule `yaml:"threshold,omitempty" json:"threshold,omitempty"` }
type Rule ¶
type Rule struct { Segment *SegmentEmbed `yaml:"segment,omitempty" json:"segment,omitempty"` Rank uint `yaml:"rank,omitempty" json:"rank,omitempty"` Distributions []*Distribution `yaml:"distributions,omitempty" json:"distributions,omitempty"` }
type Segment ¶
type Segment struct { Key string `yaml:"key,omitempty" json:"key,omitempty"` Name string `yaml:"name,omitempty" json:"name,omitempty"` Description string `yaml:"description,omitempty" json:"description,omitempty"` Constraints []*Constraint `yaml:"constraints,omitempty" json:"constraints,omitempty"` MatchType string `yaml:"match_type,omitempty" json:"match_type,omitempty"` }
type SegmentEmbed ¶ added in v1.25.0
type SegmentEmbed struct {
IsSegment `yaml:"-"`
}
func (*SegmentEmbed) MarshalJSON ¶ added in v1.31.0
func (s *SegmentEmbed) MarshalJSON() ([]byte, error)
MarshalJSON tries to type assert to either of the following types that implement IsSegment, and returns the marshaled value.
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) UnmarshalJSON ¶ added in v1.31.0
func (s *SegmentEmbed) UnmarshalJSON(v []byte) error
UnmarshalJSON attempts to unmarshal a string or `SegmentKeys`, and fails if it can not do so.
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 Segments ¶ added in v1.25.0
type ThresholdRule ¶ added in v1.24.0
type Variant ¶
type Variant struct { Default bool `yaml:"default,omitempty" json:"default,omitempty"` Key string `yaml:"key,omitempty" json:"key,omitempty"` Name string `yaml:"name,omitempty" json:"name,omitempty"` Description string `yaml:"description,omitempty" json:"description,omitempty"` Attachment interface{} `yaml:"attachment,omitempty" json:"attachment,omitempty"` }