Documentation
¶
Index ¶
- Constants
- type BetweenMatcherDataDTO
- type ConditionDTO
- type ControlNotification
- type CounterDTO
- type CounterDataBulk
- type DependencyMatcherDataDTO
- type EventDTO
- type GaugeDTO
- type GaugeDataBulk
- type HTTPError
- type Impression
- type ImpressionDTO
- type ImpressionQueueObject
- type ImpressionsCountDTO
- type ImpressionsDTO
- type ImpressionsInTimeFrameDTO
- type IncomingNotification
- type KeySelectorDTO
- type LatenciesDTO
- type LatencyDataBulk
- type MatcherDTO
- type MatcherGroupDTO
- type Metadata
- type MySegmentDTO
- type MySegmentsNotification
- type Notification
- type ParsedCapabilities
- type PartitionDTO
- type QueueStoredEventDTO
- type SegmentChangeNotification
- type SegmentChangesDTO
- type SegmentKeyDTO
- type SplitChangeNotification
- type SplitChangesDTO
- type SplitDTO
- type SplitKillNotification
- type Token
- type TokenPayload
- type UnaryNumericMatcherDataDTO
- type UserDefinedSegmentMatcherDataDTO
- type WhitelistMatcherDataDTO
Constants ¶
const ( // SplitUpdate used when split is updated SplitUpdate = "SPLIT_UPDATE" // SplitKill used when split is killed SplitKill = "SPLIT_KILL" // SegmentUpdate used when segment is updated SegmentUpdate = "SEGMENT_UPDATE" // MySegmentsUpdate used when mySegment is updated MySegmentsUpdate = "MY_SEGMENTS_UPDATE" // Control for control Control = "CONTROL" // StreamingPause for controlType StreamingPause = "STREAMING_PAUSED" // StreamingResumed for controlType StreamingResumed = "STREAMING_RESUMED" // StreamingDisabled for controlType StreamingDisabled = "STREAMING_DISABLED" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BetweenMatcherDataDTO ¶
type BetweenMatcherDataDTO struct {
DataType string `json:"dataType"` //NUMBER or DATETIME
Start int64 `json:"start"`
End int64 `json:"end"`
}
BetweenMatcherDataDTO structure to map a Matcher definition fetched from JSON message.
type ConditionDTO ¶
type ConditionDTO struct {
ConditionType string `json:"conditionType"`
MatcherGroup MatcherGroupDTO `json:"matcherGroup"`
Partitions []PartitionDTO `json:"partitions"`
Label string `json:"label"`
}
ConditionDTO structure to map a Condition fetched from JSON message.
type ControlNotification ¶
type ControlNotification struct {
ControlType string
// contains filtered or unexported fields
}
ControlNotification notification for control channels
func NewControlNotification ¶
func NewControlNotification(channelName string, controlType string) ControlNotification
NewControlNotification builds a notification for controlling connection
func (ControlNotification) ChannelName ¶
func (b ControlNotification) ChannelName() string
ChannelName returns channel name
func (ControlNotification) NotificationType ¶
func (b ControlNotification) NotificationType() string
NotificationType returns the type of the notification
type CounterDTO ¶
CounterDTO struct mapping counts post
type CounterDataBulk ¶
type CounterDataBulk struct {
// contains filtered or unexported fields
}
CounterDataBulk holds all counters fetched from storage sorted properly.
func NewCounterDataBulk ¶
func NewCounterDataBulk() *CounterDataBulk
NewCounterDataBulk creates a new Counter holding structure
func (*CounterDataBulk) ForEach ¶
func (l *CounterDataBulk) ForEach(callback func(string, string, map[string]int64))
ForEach iterates thru all counters
func (*CounterDataBulk) PutCounter ¶
func (l *CounterDataBulk) PutCounter(sdk string, machineIP string, metricName string, value int64)
PutCounter adds a counter to the structure
type DependencyMatcherDataDTO ¶
type DependencyMatcherDataDTO struct {
Split string `json:"split"`
Treatments []string `json:"treatments"`
}
DependencyMatcherDataDTO structure to map matcher definition fetched from JSON message.
type EventDTO ¶
type EventDTO struct {
Key string `json:"key"`
TrafficTypeName string `json:"trafficTypeName"`
EventTypeID string `json:"eventTypeId"`
Value interface{} `json:"value"`
Timestamp int64 `json:"timestamp"`
Properties map[string]interface{} `json:"properties,omitempty"`
}
EventDTO struct mapping events json
type GaugeDataBulk ¶
type GaugeDataBulk struct {
// contains filtered or unexported fields
}
GaugeDataBulk holds all gauges fetched from storage sorted properly.
func NewGaugeDataBulk ¶
func NewGaugeDataBulk() *GaugeDataBulk
NewGaugeDataBulk creates a new Gauge holding structure
type Impression ¶
type Impression struct {
KeyName string `json:"k"`
BucketingKey string `json:"b"`
FeatureName string `json:"f"`
Treatment string `json:"t"`
Label string `json:"r"`
ChangeNumber int64 `json:"c"`
Time int64 `json:"m"`
Pt int64 `json:"pt,omitempty"`
}
Impression struct to map an impression
type ImpressionDTO ¶
type ImpressionDTO struct {
KeyName string `json:"k"`
Treatment string `json:"t"`
Time int64 `json:"m"`
ChangeNumber int64 `json:"c"`
Label string `json:"r"`
BucketingKey string `json:"b,omitempty"`
Pt int64 `json:"pt,omitempty"`
}
ImpressionDTO struct to map an impression
type ImpressionQueueObject ¶
type ImpressionQueueObject struct {
Metadata Metadata `json:"m"`
Impression Impression `json:"i"`
}
ImpressionQueueObject struct mapping impressions
type ImpressionsCountDTO ¶
type ImpressionsCountDTO struct {
PerFeature []ImpressionsInTimeFrameDTO `json:"pf"`
}
ImpressionsCountDTO struct mapping impressions count to post
type ImpressionsDTO ¶
type ImpressionsDTO struct {
TestName string `json:"f"`
KeyImpressions []ImpressionDTO `json:"i"`
}
ImpressionsDTO struct mapping impressions to post
type ImpressionsInTimeFrameDTO ¶
type ImpressionsInTimeFrameDTO struct {
FeatureName string `json:"f"`
TimeFrame int64 `json:"m"`
RawCount int64 `json:"rc"`
}
ImpressionsInTimeFrameDTO struct mapping impressionsCount in time window
type IncomingNotification ¶
type IncomingNotification struct {
Channel string `json:"channel"`
ChangeNumber *int64 `json:"changeNumber,omitempty"`
ControlType *string `json:"controlType,omitempty"`
DefaultTreatment *string `json:"defaultTreatment,omitempty"`
SegmentName *string `json:"segmentName,omitempty"`
SplitName *string `json:"splitName,omitempty"`
Timestamp *int64 `json:"timestamp,omitempty"`
Type string `json:"type"`
}
IncomingNotification struct for incoming notification from streaming
type KeySelectorDTO ¶
type KeySelectorDTO struct {
TrafficType string `json:"trafficType"`
Attribute *string `json:"attribute"`
}
KeySelectorDTO structure to map a Key slector definition fetched from JSON message.
type LatenciesDTO ¶
LatenciesDTO struct mapping latencies post
type LatencyDataBulk ¶
type LatencyDataBulk struct {
// contains filtered or unexported fields
}
LatencyDataBulk holds all latencies fetched from storage sorted properly.
func NewLatencyDataBulk ¶
func NewLatencyDataBulk() *LatencyDataBulk
NewLatencyDataBulk creates a new Latency holding structure
func (*LatencyDataBulk) ForEach ¶
func (l *LatencyDataBulk) ForEach(callback func(string, string, map[string][]int64))
ForEach iterates thru all latencies
func (*LatencyDataBulk) PutLatency ¶
func (l *LatencyDataBulk) PutLatency(sdk string, machineIP string, metricName string, bucketNumber int, value int64)
PutLatency adds a new latency to the structure
type MatcherDTO ¶
type MatcherDTO struct {
KeySelector *KeySelectorDTO `json:"keySelector"`
MatcherType string `json:"matcherType"`
Negate bool `json:"negate"`
UserDefinedSegment *UserDefinedSegmentMatcherDataDTO `json:"userDefinedSegmentMatcherData"`
Whitelist *WhitelistMatcherDataDTO `json:"whitelistMatcherData"`
UnaryNumeric *UnaryNumericMatcherDataDTO `json:"unaryNumericMatcherData"`
Between *BetweenMatcherDataDTO `json:"betweenMatcherData"`
Dependency *DependencyMatcherDataDTO `json:"dependencyMatcherData"`
Boolean *bool `json:"booleanMatcherData"`
String *string `json:"stringMatcherData"`
}
MatcherDTO structure to map a Matcher definition fetched from JSON message.
type MatcherGroupDTO ¶
type MatcherGroupDTO struct {
Combiner string `json:"combiner"`
Matchers []MatcherDTO `json:"matchers"`
}
MatcherGroupDTO structure to map a Matcher Group definition fetched from JSON message.
type Metadata ¶
type Metadata struct {
SDKVersion string `json:"s"`
MachineIP string `json:"i"`
MachineName string `json:"n"`
}
Metadata is used to store sdk metadata
type MySegmentDTO ¶
type MySegmentDTO struct {
Name string `json:"name"`
}
MySegmentDTO struct mapping segment data for mySegments endpoint
type MySegmentsNotification ¶
type MySegmentsNotification struct {
IncludesPayload bool
Payload []string
ChangeNumber int64
// contains filtered or unexported fields
}
MySegmentsNotification notification when MySegments is updated
func NewMySegmentsNotification ¶
func NewMySegmentsNotification(channelName string, includesPayload bool, payload []string, changeNumber int64) MySegmentsNotification
NewMySegmentsNotification builds a MySegments notification
func (MySegmentsNotification) ChannelName ¶
func (b MySegmentsNotification) ChannelName() string
ChannelName returns channel name
func (MySegmentsNotification) NotificationType ¶
func (b MySegmentsNotification) NotificationType() string
NotificationType returns the type of the notification
type Notification ¶
Notification should be implemented by all notification types
type ParsedCapabilities ¶
ParsedCapabilities capabilities
type PartitionDTO ¶
PartitionDTO structure to map a Partition definition fetched from JSON message.
type QueueStoredEventDTO ¶
QueueStoredEventDTO maps the stored JSON object in redis by SDKs
type SegmentChangeNotification ¶
type SegmentChangeNotification struct {
ChangeNumber int64
SegmentName string
// contains filtered or unexported fields
}
SegmentChangeNotification notification when a Segment is updated
func NewSegmentChangeNotification ¶
func NewSegmentChangeNotification(channelName string, changeNumber int64, segmentName string) SegmentChangeNotification
NewSegmentChangeNotification builds a segment change notification
func (SegmentChangeNotification) ChannelName ¶
func (b SegmentChangeNotification) ChannelName() string
ChannelName returns channel name
func (SegmentChangeNotification) NotificationType ¶
func (b SegmentChangeNotification) NotificationType() string
NotificationType returns the type of the notification
type SegmentChangesDTO ¶
type SegmentChangesDTO struct {
Name string `json:"name"`
Added []string `json:"added"`
Removed []string `json:"removed"`
Since int64 `json:"since"`
Till int64 `json:"till"`
}
SegmentChangesDTO struct to map a segment change message.
type SegmentKeyDTO ¶
type SegmentKeyDTO struct {
Name string `json:"name"`
LastModified int64 `json:"lastModified"`
Removed bool `json:"removed"`
}
SegmentKeyDTO maps key data
type SplitChangeNotification ¶
type SplitChangeNotification struct {
ChangeNumber int64
// contains filtered or unexported fields
}
SplitChangeNotification notification to send a fetch to splitChanges
func NewSplitChangeNotification ¶
func NewSplitChangeNotification(channelName string, changeNumber int64) SplitChangeNotification
NewSplitChangeNotification builds a split change notification
func (SplitChangeNotification) ChannelName ¶
func (b SplitChangeNotification) ChannelName() string
ChannelName returns channel name
func (SplitChangeNotification) NotificationType ¶
func (b SplitChangeNotification) NotificationType() string
NotificationType returns the type of the notification
type SplitChangesDTO ¶
type SplitChangesDTO struct {
Till int64 `json:"till"`
Since int64 `json:"since"`
Splits []SplitDTO `json:"splits"`
}
SplitChangesDTO structure to map JSON message sent by Split servers.
type SplitDTO ¶
type SplitDTO struct {
ChangeNumber int64 `json:"changeNumber"`
TrafficTypeName string `json:"trafficTypeName"`
Name string `json:"name"`
TrafficAllocation int `json:"trafficAllocation"`
TrafficAllocationSeed int64 `json:"trafficAllocationSeed"`
Seed int64 `json:"seed"`
Status string `json:"status"`
Killed bool `json:"killed"`
DefaultTreatment string `json:"defaultTreatment"`
Algo int `json:"algo"`
Conditions []ConditionDTO `json:"conditions"`
Configurations map[string]string `json:"configurations"`
}
SplitDTO structure to map an Split definition fetched from JSON message.
func (SplitDTO) MarshalBinary ¶
MarshalBinary exports SplitDTO to JSON string
type SplitKillNotification ¶
type SplitKillNotification struct {
ChangeNumber int64
DefaultTreatment string
SplitName string
// contains filtered or unexported fields
}
SplitKillNotification notification when Split is killed
func NewSplitKillNotification ¶
func NewSplitKillNotification(channelName string, changeNumber int64, defaultTreatment string, splitName string) SplitKillNotification
NewSplitKillNotification builds a killed split notification
func (SplitKillNotification) ChannelName ¶
func (b SplitKillNotification) ChannelName() string
ChannelName returns channel name
func (SplitKillNotification) NotificationType ¶
func (b SplitKillNotification) NotificationType() string
NotificationType returns the type of the notification
type Token ¶
Token dto
func (*Token) CalculateNextTokenExpiration ¶
CalculateNextTokenExpiration calculates next token expiration
func (*Token) ChannelList ¶
ChannelList grabs the channel list from capabilities
type TokenPayload ¶
type TokenPayload struct {
Capabilitites string `json:"x-ably-capability"`
Exp int64 `json:"exp"`
Iat int64 `json:"iat"`
}
TokenPayload payload dto
type UnaryNumericMatcherDataDTO ¶
type UnaryNumericMatcherDataDTO struct {
DataType string `json:"dataType"` //NUMBER or DATETIME
Value int64 `json:"value"`
}
UnaryNumericMatcherDataDTO structure to map a Matcher definition fetched from JSON message.
type UserDefinedSegmentMatcherDataDTO ¶
type UserDefinedSegmentMatcherDataDTO struct {
SegmentName string `json:"segmentName"`
}
UserDefinedSegmentMatcherDataDTO structure to map a Matcher definition fetched from JSON message.
type WhitelistMatcherDataDTO ¶
type WhitelistMatcherDataDTO struct {
Whitelist []string `json:"whitelist"`
}
WhitelistMatcherDataDTO structure to map a Matcher definition fetched from JSON message.