Documentation ¶
Index ¶
- type Actor
- type Checker
- type Constraint
- type Distribution
- type Event
- type EventExporter
- type EventPairChecker
- type Flag
- type Metadata
- type Namespace
- type NoOpChecker
- type RequestCreator
- type Retrier
- type Rollout
- type RolloutSegment
- type RolloutThreshold
- type Rule
- type Segment
- type Sink
- type SinkSpanExporter
- type Variant
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checker ¶ added in v1.27.0
type Checker struct {
// contains filtered or unexported fields
}
Checker holds a map that maps event pairs to a dummy struct. It is basically used as a set to check for existence.
func NewChecker ¶ added in v1.27.0
NewChecker is the constructor for a Checker.
type Constraint ¶
type Constraint struct { Id string `json:"id"` SegmentKey string `json:"segment_key"` Type string `json:"type"` Property string `json:"property"` Operator string `json:"operator"` Value string `json:"value"` NamespaceKey string `json:"namespace_key"` }
func NewConstraint ¶
func NewConstraint(c *flipt.Constraint) *Constraint
type Distribution ¶
type Distribution struct { Id string `json:"id"` RuleId string `json:"rule_id"` VariantId string `json:"variant_id"` Rollout float32 `json:"rollout"` }
func NewDistribution ¶
func NewDistribution(d *flipt.Distribution) *Distribution
type Event ¶
type Event struct { Version string `json:"version"` Type string `json:"type"` Action string `json:"action"` Metadata Metadata `json:"metadata"` Payload interface{} `json:"payload"` Timestamp string `json:"timestamp"` Status string `json:"status"` }
Event holds information that represents an action that was attempted in the system.
func (Event) DecodeToAttributes ¶
DecodeToAttributes provides a helper method for an Event that will return a value compatible to a SpanEvent.
func (Event) MarshalLogObject ¶ added in v1.44.0
func (e Event) MarshalLogObject(enc zapcore.ObjectEncoder) error
type EventExporter ¶
type EventExporter interface { ExportSpans(ctx context.Context, spans []sdktrace.ReadOnlySpan) error Shutdown(ctx context.Context) error SendAudits(ctx context.Context, es []Event) error }
EventExporter provides an API for exporting spans as Event(s).
func NewSinkSpanExporter ¶
func NewSinkSpanExporter(logger *zap.Logger, sinks []Sink) EventExporter
NewSinkSpanExporter is the constructor for a SinkSpanExporter.
type EventPairChecker ¶ added in v1.44.0
EventPairChecker is the contract for checking if an event pair exists and if it should be emitted to configured sinks.
type Flag ¶
type Metadata ¶
type Metadata struct {
Actor *Actor `json:"actor,omitempty"`
}
Metadata holds information of what metadata an event will contain.
type Namespace ¶
type Namespace struct { Key string `json:"key"` Name string `json:"name"` Description string `json:"description"` Protected bool `json:"protected"` }
func NewNamespace ¶
type NoOpChecker ¶ added in v1.44.0
type NoOpChecker struct{}
func (*NoOpChecker) Check ¶ added in v1.44.0
func (n *NoOpChecker) Check(eventPair string) bool
func (*NoOpChecker) Events ¶ added in v1.44.0
func (n *NoOpChecker) Events() []string
type RequestCreator ¶ added in v1.28.0
RequestCreator provides a basic function for rewinding a request with a body, upon request failure.
type Retrier ¶ added in v1.28.0
type Retrier interface {
RequestRetry(ctx context.Context, body []byte, fn RequestCreator) error
}
Retrier contains a minimal API for retrying a request onto an endpoint upon failure or non-200 status.
type Rollout ¶ added in v1.24.0
type Rollout struct { NamespaceKey string `json:"namespace_key"` FlagKey string `json:"flag_key"` Rank int32 `json:"rank"` Description string `json:"description"` Threshold *RolloutThreshold `json:"threshold,omitempty"` Segment *RolloutSegment `json:"segment,omitempty"` }
func NewRollout ¶ added in v1.24.0
type RolloutSegment ¶ added in v1.24.0
type RolloutThreshold ¶ added in v1.24.0
type Rule ¶
type Segment ¶
type Segment struct { Key string `json:"key"` Name string `json:"name"` Description string `json:"description"` Constraints []*Constraint `json:"constraints"` MatchType string `json:"match_type"` NamespaceKey string `json:"namespace_key"` }
func NewSegment ¶
type SinkSpanExporter ¶
type SinkSpanExporter struct {
// contains filtered or unexported fields
}
SinkSpanExporter sends audit logs to configured sinks through intercepting span events.
func (*SinkSpanExporter) ExportSpans ¶
func (s *SinkSpanExporter) ExportSpans(ctx context.Context, spans []sdktrace.ReadOnlySpan) error
ExportSpans completes one part of the implementation of a SpanExporter. Decodes span events to audit events.
func (*SinkSpanExporter) SendAudits ¶
func (s *SinkSpanExporter) SendAudits(ctx context.Context, es []Event) error
SendAudits wraps the methods of sending audits events to various sinks.