Documentation ¶
Index ¶
Constants ¶
const ( ConstraintType Type = "constraint" DistributionType Type = "distribution" FlagType Type = "flag" NamespaceType Type = "namespace" RuleType Type = "rule" SegmentType Type = "segment" TokenType Type = "token" VariantType Type = "variant" Create Action = "created" Delete Action = "deleted" Update Action = "updated" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action string
Action represents the action being taken on the resource.
func GRPCMethodToAction ¶
GRPCMethodToAction returns the Action from the gRPC method.
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 Type `json:"type"` Action Action `json:"action"` Metadata Metadata `json:"metadata"` Payload interface{} `json:"payload"` Timestamp string `json:"timestamp"` }
Event holds information that represents an audit internally.
func (Event) DecodeToAttributes ¶
DecodeToAttributes provides a helper method for an Event that will return a value compatible to a SpanEvent.
type EventExporter ¶
type EventExporter interface { ExportSpans(ctx context.Context, spans []sdktrace.ReadOnlySpan) error Shutdown(ctx context.Context) error SendAudits(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 Flag ¶
type Namespace ¶
type Namespace struct { Key string `json:"key"` Name string `json:"name"` Description string `json:"description"` Protected bool `json:"protected"` }
func NewNamespace ¶
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(es []Event) error
SendAudits wraps the methods of sending audits to various sinks.