dtos

package
v8.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

View Source
const (
	MessageTypeUpdate = iota
	MessageTypeControl
	MessageTypeOccupancy
)

Message type constants

View Source
const (
	UpdateTypeSplitChange        = "SPLIT_UPDATE"
	UpdateTypeSplitKill          = "SPLIT_KILL"
	UpdateTypeSegmentChange      = "SEGMENT_UPDATE"
	UpdateTypeControl            = "CONTROL"
	UpdateTypeLargeSegmentChange = "LS_DEFINITION_UPDATE"
	UpdateTypeRuleBasedChange    = "RB_SEGMENT_UPDATE"
)

Update type constants

View Source
const (
	ControlTypeStreamingEnabled  = "STREAMING_ENABLED"
	ControlTypeStreamingPaused   = "STREAMING_PAUSED"
	ControlTypeStreamingDisabled = "STREAMING_DISABLED"
)

Control type constants

View Source
const (
	SSEEventTypeError   = "error"
	SSEEventTypeSync    = "sync"
	SSEEventTypeMessage = "message"
)

SSE event type constants

View Source
const (
	TypeStandard  = "standard"
	TypeRuleBased = "rule-based"
	TypeLarge     = "large"
)

Excluded segment types

Variables

This section is empty.

Functions

This section is empty.

Types

type AblyError

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

AblyError struct

func NewAblyError

func NewAblyError(code int, statusCode int, message string, href string, timestamp int64) *AblyError

func (*AblyError) Code

func (a *AblyError) Code() int

Code returns the error code

func (*AblyError) EventType

func (a *AblyError) EventType() string

EventType always returns SSEEventTypeError for AblyError

func (*AblyError) Href

func (a *AblyError) Href() string

Href returns the documentation link

func (*AblyError) IsRetryable

func (a *AblyError) IsRetryable() bool

IsRetryable returns whether the error is recoverable via a push subsystem restart

func (*AblyError) Message

func (a *AblyError) Message() string

Message returns the error message

func (*AblyError) StatusCode

func (a *AblyError) StatusCode() int

StatusCode returns the status code

func (*AblyError) String

func (a *AblyError) String() string

String returns the string representation of the ably error

func (*AblyError) Timestamp

func (a *AblyError) Timestamp() int64

Timestamp returns the error timestamp

type BaseMessage

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

BaseMessage contains the basic message-specific fields and methods

func NewBaseMessage

func NewBaseMessage(timestamp int64, channel string) BaseMessage

func (*BaseMessage) Channel

func (m *BaseMessage) Channel() string

Channel returns which channel the message was received in

func (*BaseMessage) EventType

func (m *BaseMessage) EventType() string

EventType always returns SSEEventTypeMessage for BaseMessage and embedding types

func (*BaseMessage) Timestamp

func (m *BaseMessage) Timestamp() int64

Timestamp returns the timestamp of the message reception

type BaseUpdate

type BaseUpdate struct {
	BaseMessage
	// contains filtered or unexported fields
}

BaseUpdate contains fields & methods related to update-based messages

func NewBaseUpdate

func NewBaseUpdate(baseMessage BaseMessage, changeNumber int64) BaseUpdate

func (*BaseUpdate) ChangeNumber

func (b *BaseUpdate) ChangeNumber() int64

ChangeNumber returns the changeNumber of the update

func (*BaseUpdate) MessageType

func (b *BaseUpdate) MessageType() int64

MessageType alwats returns MessageType for Update messages

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 BetweenStringMatcherDataDTO

type BetweenStringMatcherDataDTO struct {
	Start *string `json:"start"`
	End   *string `json:"end"`
}

BetweenStringMatcherDataDTO 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 Config

type Config struct {
	OperationMode              int           `json:"oM,omitempty"`
	StreamingEnabled           bool          `json:"sE,omitempty"`
	Storage                    string        `json:"st,omitempty"`
	Rates                      *Rates        `json:"rR,omitempty"`
	URLOverrides               *URLOverrides `json:"uO,omitempty"`
	ImpressionsQueueSize       int64         `json:"iQ,omitempty"`
	EventsQueueSize            int64         `json:"eQ,omitempty"`
	ImpressionsMode            int           `json:"iM,omitempty"`
	ImpressionsListenerEnabled bool          `json:"iL,omitempty"`
	HTTPProxyDetected          bool          `json:"hP,omitempty"`
	ActiveFactories            int64         `json:"aF,omitempty"`
	RedundantFactories         int64         `json:"rF,omitempty"`
	TimeUntilReady             int64         `json:"tR,omitempty"`
	BurTimeouts                int64         `json:"bT,omitempty"`
	NonReadyUsages             int64         `json:"nR,omitempty"`
	Integrations               []string      `json:"i,omitempty"`
	Tags                       []string      `json:"t,omitempty"`
	FlagSetsTotal              int64         `json:"fsT,omitempty"`
	FlagSetsInvalid            int64         `json:"fsI,omitempty"`
}

Config data for initial configs metrics

type ControlUpdate

type ControlUpdate struct {
	BaseMessage
	// contains filtered or unexported fields
}

ControlUpdate represents a control notification generated by the split push subsystem

func NewControlUpdate

func NewControlUpdate(baseMessage BaseMessage, controlType string) *ControlUpdate

func (*ControlUpdate) ControlType

func (u *ControlUpdate) ControlType() string

ControlType returns the type of control notification received

func (*ControlUpdate) MessageType

func (u *ControlUpdate) MessageType() int64

MessageType always returns MessageTypeControl for Control messages

func (*ControlUpdate) String

func (u *ControlUpdate) String() string

String returns a string representation of this notification

type Data

type Data struct {
	Interval  *int64 `json:"i,omitempty"` // interval
	Format    int    `json:"f"`           // 0 unknown | 1 csv | otro // format
	TotalKeys int64  `json:"k"`           // totalKeys
	FileSize  int64  `json:"s"`           // fileSize
	ExpiresAt int64  `json:"e"`           // expiration time url
}

Data

type DependencyMatcherDataDTO

type DependencyMatcherDataDTO struct {
	Split      string   `json:"split"`
	Treatments []string `json:"treatments"`
}

DependencyMatcherDataDTO structure to map matcher definition fetched from JSON message.

type Event

type Event interface {
	fmt.Stringer
	EventType() string
	Timestamp() int64
}

Event basic interface

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

func (*EventDTO) Size

func (e *EventDTO) Size() int

Size returns a relatively accurate estimation of the size of the event

type ExcludedDTO

type ExcludedDTO struct {
	Keys     []string             `json:"keys"`
	Segments []ExcludedSegmentDTO `json:"segments"`
}

type ExcludedSegmentDTO

type ExcludedSegmentDTO struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

type FFResponse

type FFResponse interface {
	NeedsAnotherFetch() bool
	RuleBasedSegments() []RuleBasedSegmentDTO
	FeatureFlags() []SplitDTO
	FFTill() int64
	RBTill() int64
	FFSince() int64
	RBSince() int64
}

FFResponse is an interface that abstracts the differences between different versions of feature flag responses.

func NewFFResponseLegacy

func NewFFResponseLegacy(data []byte) (FFResponse, error)

NewFFResponseLegacy creates a new FFResponseLegacy instance from the provided JSON data.

func NewFFResponseV13

func NewFFResponseV13(data []byte) (FFResponse, error)

NewFFResponseV13 creates a new FFResponseV13 instance from the provided JSON data.

type FFResponseLegacy

type FFResponseLegacy struct {
	SplitChanges SplitChangesDTO
}

FFResponseLegacy handles the legacy format of feature flag responses.

func (*FFResponseLegacy) FFSince

func (ffLegacy *FFResponseLegacy) FFSince() int64

FFSince returns the since value for feature flags.

func (*FFResponseLegacy) FFTill

func (ffLegacy *FFResponseLegacy) FFTill() int64

FFTill returns the till value for feature flags.

func (*FFResponseLegacy) FeatureFlags

func (ffLegacy *FFResponseLegacy) FeatureFlags() []SplitDTO

FeatureFlags returns the list of feature flags (splits) from the response.

func (*FFResponseLegacy) NeedsAnotherFetch

func (ffLegacy *FFResponseLegacy) NeedsAnotherFetch() bool

NeedsAnotherFetch checks if another fetch is needed based on the since and till values.

func (*FFResponseLegacy) RBSince

func (ffLegacy *FFResponseLegacy) RBSince() int64

RBSince returns 0 as legacy responses do not contain rule-based segments.

func (*FFResponseLegacy) RBTill

func (ffLegacy *FFResponseLegacy) RBTill() int64

RBTill returns 0 as legacy responses do not contain rule-based segments.

func (*FFResponseLegacy) RuleBasedSegments

func (ffLegacy *FFResponseLegacy) RuleBasedSegments() []RuleBasedSegmentDTO

RuleBasedSegments returns an empty list as legacy responses do not contain rule-based segments.

type FFResponseLocalV13

type FFResponseLocalV13 struct {
	SplitChanges RuleChangesDTO
}

FFResponseLocalV13 is a local version of FFResponseV13 for internal use.

func NewFFResponseLocalV13

func NewFFResponseLocalV13(data []byte) (*FFResponseLocalV13, error)

NewFFResponseLocalV13 creates a new FFResponseLocalV13 instance from the provided JSON data.

func (*FFResponseLocalV13) FFSince

func (f *FFResponseLocalV13) FFSince() int64

FFSince returns the since value for feature flags.

func (*FFResponseLocalV13) FFTill

func (f *FFResponseLocalV13) FFTill() int64

FFTill returns the till value for feature flags.

func (*FFResponseLocalV13) FeatureFlags

func (f *FFResponseLocalV13) FeatureFlags() []SplitDTO

FeatureFlags returns the list of feature flags (splits) from the response.

func (FFResponseLocalV13) NeedsAnotherFetch

func (f FFResponseLocalV13) NeedsAnotherFetch() bool

NeedsAnotherFetch checks if another fetch is needed based on the since and till values for both feature flags and rule-based segments.

func (*FFResponseLocalV13) RBSince

func (f *FFResponseLocalV13) RBSince() int64

RBSince returns the since value for rule-based segments.

func (*FFResponseLocalV13) RBTill

func (f *FFResponseLocalV13) RBTill() int64

RBTill returns the till value for rule-based segments.

func (*FFResponseLocalV13) ReplaceFF

func (f *FFResponseLocalV13) ReplaceFF(featureFlags []SplitDTO)

ReplaceFF replaces the feature flags (splits) in the response with the provided list.

func (*FFResponseLocalV13) ReplaceRB

func (f *FFResponseLocalV13) ReplaceRB(ruleBasedSegments []RuleBasedSegmentDTO)

ReplaceRB replaces the rule-based segments in the response with the provided list.

func (*FFResponseLocalV13) RuleBasedSegments

func (f *FFResponseLocalV13) RuleBasedSegments() []RuleBasedSegmentDTO

RuleBasedSegments returns the list of rule-based segments from the response.

func (*FFResponseLocalV13) SetFFSince

func (f *FFResponseLocalV13) SetFFSince(since int64)

SetFFSince sets the since value for feature flags.

func (*FFResponseLocalV13) SetFFTill

func (f *FFResponseLocalV13) SetFFTill(till int64)

FFSince returns the since value for feature flags.

func (*FFResponseLocalV13) SetRBSince

func (f *FFResponseLocalV13) SetRBSince(since int64)

SetRBSince sets the since value for rule-based segments.

func (*FFResponseLocalV13) SetRBTill

func (f *FFResponseLocalV13) SetRBTill(till int64)

SetRBTill sets the till value for rule-based segments.

type FFResponseV13

type FFResponseV13 struct {
	SplitChanges RuleChangesDTO
}

FFResponseV13 handles the version 1.3 format of feature flag responses.

func (*FFResponseV13) FFSince

func (f13 *FFResponseV13) FFSince() int64

FFSince returns the since value for feature flags.

func (*FFResponseV13) FFTill

func (f13 *FFResponseV13) FFTill() int64

FFTill returns the till value for feature flags.

func (*FFResponseV13) FeatureFlags

func (f13 *FFResponseV13) FeatureFlags() []SplitDTO

FeatureFlags returns the list of feature flags (splits) from the response.

func (FFResponseV13) NeedsAnotherFetch

func (f13 FFResponseV13) NeedsAnotherFetch() bool

NeedsAnotherFetch checks if another fetch is needed based on the since and till values for both feature flags and rule-based segments.

func (*FFResponseV13) RBSince

func (f13 *FFResponseV13) RBSince() int64

RBSince returns the since value for rule-based segments.

func (*FFResponseV13) RBTill

func (f13 *FFResponseV13) RBTill() int64

RBTill returns the till value for rule-based segments.

func (*FFResponseV13) RuleBasedSegments

func (f13 *FFResponseV13) RuleBasedSegments() []RuleBasedSegmentDTO

RuleBasedSegments returns the list of rule-based segments from the response.

type FeatureFlagsDTO

type FeatureFlagsDTO struct {
	Since  int64      `json:"s"`
	Till   int64      `json:"t"`
	Splits []SplitDTO `json:"d"`
}

type FlagSetValidatonError

type FlagSetValidatonError struct {
	Message string
}

FlagSetValidatonError represents a flag set validaton error

func (FlagSetValidatonError) Error

func (f FlagSetValidatonError) Error() string

Error implements golang error interface

type HTTPError

type HTTPError struct {
	Code    int
	Message string
}

HTTPError represents a http error

func (HTTPError) Error

func (h HTTPError) Error() string

Error implements golang error interface

type HTTPErrors

type HTTPErrors struct {
	Splits           map[int]int64 `json:"sp,omitempty"`
	Segments         map[int]int64 `json:"se,omitempty"`
	Impressions      map[int]int64 `json:"im,omitempty"`
	ImpressionsCount map[int]int64 `json:"ic,omitempty"`
	Events           map[int]int64 `json:"ev,omitempty"`
	Token            map[int]int64 `json:"to,omitempty"`
	Telemetry        map[int]int64 `json:"te,omitempty"`
}

HTTPErrors struct

type HTTPLatencies

type HTTPLatencies struct {
	Splits           []int64 `json:"sp,omitempty"`
	Segments         []int64 `json:"se,omitempty"`
	Impressions      []int64 `json:"im,omitempty"`
	ImpressionsCount []int64 `json:"ic,omitempty"`
	Events           []int64 `json:"ev,omitempty"`
	Token            []int64 `json:"to,omitempty"`
	Telemetry        []int64 `json:"te,omitempty"`
}

HTTPLatencies struct

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"`
	Disabled     bool   `json:"-"`
}

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 Key

type Key struct {
	Feature string   `json:"f,omitempty"`
	Keys    []string `json:"ks,omitempty"`
}

Key struct

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 LargeSegment

type LargeSegment struct {
	Name         string
	Keys         []string
	ChangeNumber int64
}

LargeSegment

type LargeSegmentChangeUpdate

type LargeSegmentChangeUpdate struct {
	BaseUpdate
	LargeSegments []LargeSegmentRFDResponseDTO `json:"ls"`
}

func NewLargeSegmentChangeUpdate

func NewLargeSegmentChangeUpdate(baseUpdate BaseUpdate, largeSegments []LargeSegmentRFDResponseDTO) *LargeSegmentChangeUpdate

func (*LargeSegmentChangeUpdate) String

func (u *LargeSegmentChangeUpdate) String() string

String returns the string representation of a segment update notification

func (*LargeSegmentChangeUpdate) UpdateType

func (u *LargeSegmentChangeUpdate) UpdateType() string

UpdateType is always UpdateTypeLargeSegmentChange for Large Segmet Updates

type LargeSegmentRFDResponseDTO

type LargeSegmentRFDResponseDTO struct {
	Name             string `json:"n"`
	NotificationType string `json:"t"`
	RFD              *RFD   `json:"rfd,omitempty"`
	SpecVersion      string `json:"v"`
	ChangeNumber     int64  `json:"cn"`
}

LargeSegmentRFDResponseDTO

type LastSynchronization

type LastSynchronization struct {
	Splits           int64 `json:"sp,omitempty"`
	Segments         int64 `json:"se,omitempty"`
	Impressions      int64 `json:"im,omitempty"`
	ImpressionsCount int64 `json:"ic,omitempty"`
	Events           int64 `json:"ev,omitempty"`
	Token            int64 `json:"to,omitempty"`
	Telemetry        int64 `json:"te,omitempty"`
}

LastSynchronization struct

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"`
	BetweenString           *BetweenStringMatcherDataDTO           `json:"betweenStringMatcherData"`
	Dependency              *DependencyMatcherDataDTO              `json:"dependencyMatcherData"`
	Boolean                 *bool                                  `json:"booleanMatcherData"`
	String                  *string                                `json:"stringMatcherData"`
	UserDefinedLargeSegment *UserDefinedLargeSegmentMatcherDataDTO `json:"userDefinedLargeSegmentMatcherData"`
}

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 Memberships

type Memberships struct {
	Segments     []Segment `json:"k"`
	ChangeNumber *int64    `json:"cn,omitempty"`
}

Memberships struct mapping segments data for memberships endpoint

type MembershipsResponseDTO

type MembershipsResponseDTO struct {
	MySegments      Memberships `json:"ms"`
	MyLargeSegments Memberships `json:"ls"`
}

MembershipsResponseDTO struct mapping memberships data for memberships endpoint

type Message

type Message interface {
	Event
	MessageType() int64
	Channel() string
}

Message basic interface

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 MethodExceptions

type MethodExceptions struct {
	Treatment                      int64 `json:"t,omitempty"`
	Treatments                     int64 `json:"ts,omitempty"`
	TreatmentWithConfig            int64 `json:"tc,omitempty"`
	TreatmentsWithConfig           int64 `json:"tcs,omitempty"`
	TreatmentsByFlagSet            int64 `json:"tf,omitempty"`
	TreatmentsByFlagSets           int64 `json:"tfs,omitempty"`
	TreatmentsWithConfigByFlagSet  int64 `json:"tcf,omitempty"`
	TreatmentsWithConfigByFlagSets int64 `json:"tcfs,omitempty"`
	Track                          int64 `json:"tr,omitempty"`
}

MethodExceptions struct

type MethodLatencies

type MethodLatencies struct {
	Treatment                      []int64 `json:"t,omitempty"`
	Treatments                     []int64 `json:"ts,omitempty"`
	TreatmentWithConfig            []int64 `json:"tc,omitempty"`
	TreatmentsWithConfig           []int64 `json:"tcs,omitempty"`
	TreatmentsByFlagSet            []int64 `json:"tf,omitempty"`
	TreatmentsByFlagSets           []int64 `json:"tfs,omitempty"`
	TreatmentsWithConfigByFlagSet  []int64 `json:"tcf,omitempty"`
	TreatmentsWithConfigByFlagSets []int64 `json:"tcfs,omitempty"`
	Track                          []int64 `json:"tr,omitempty"`
}

MethodLatencies struct

type MySegmentDTO

type MySegmentDTO struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

MySegmentDTO struct mapping segment data for mySegments endpoint

type OccupancyMessage

type OccupancyMessage struct {
	BaseMessage
	// contains filtered or unexported fields
}

OccupancyMessage contains fields & methods related to ocupancy messages

func NewOccupancyMessage

func NewOccupancyMessage(baseMessage BaseMessage, publishers int64) *OccupancyMessage

func (*OccupancyMessage) ChannelWithoutPrefix

func (o *OccupancyMessage) ChannelWithoutPrefix() string

ChannelWithoutPrefix returns the original channel namem without the metadata prefix

func (*OccupancyMessage) MessageType

func (o *OccupancyMessage) MessageType() int64

MessageType always returns MessageTypeOccupancy for Occupancy messages

func (*OccupancyMessage) Publishers

func (o *OccupancyMessage) Publishers() int64

Publishers returbs the amount of publishers in the current channel

func (*OccupancyMessage) String

func (o *OccupancyMessage) String() string

Strings returns the string representation of an occupancy message

type Params

type Params struct {
	Method  string      `json:"m"`           // method
	URL     string      `json:"u"`           // url
	Headers http.Header `json:"h"`           // headers
	Body    []byte      `json:"b,omitempty"` // body
}

Params

type ParsedCapabilities

type ParsedCapabilities map[string][]string

ParsedCapabilities capabilities

type PartitionDTO

type PartitionDTO struct {
	Treatment string `json:"treatment"`
	Size      int    `json:"size"`
}

PartitionDTO structure to map a Partition definition fetched from JSON message.

type Prerequisite

type Prerequisite struct {
	FeatureFlagName string   `json:"n"`
	Treatments      []string `json:"ts"`
}

Prerequisites structure to map a Prerequisite fetched from JSON message

type QueueStoredEventDTO

type QueueStoredEventDTO struct {
	Metadata Metadata `json:"m"`
	Event    EventDTO `json:"e"`
}

QueueStoredEventDTO maps the stored JSON object in redis by SDKs

type RFD

type RFD struct {
	Data   Data   `json:"d"`
	Params Params `json:"p"`
}

RFD struct

type Rates

type Rates struct {
	Splits      int64 `json:"sp,omitempty"`
	Segments    int64 `json:"se,omitempty"`
	Impressions int64 `json:"im,omitempty"`
	Events      int64 `json:"ev,omitempty"`
	Telemetry   int64 `json:"te,omitempty"`
}

Rates struct

type RuleBasedConditionDTO

type RuleBasedConditionDTO struct {
	ConditionType string          `json:"conditionType"`
	MatcherGroup  MatcherGroupDTO `json:"matcherGroup"`
}

ConditionDTO structure to map a Condition fetched from JSON message.

type RuleBasedSegmentDTO

type RuleBasedSegmentDTO struct {
	ChangeNumber    int64                   `json:"changeNumber"`
	Name            string                  `json:"name"`
	Status          string                  `json:"status"`
	TrafficTypeName string                  `json:"trafficTypeName"`
	Excluded        ExcludedDTO             `json:"excluded"`
	Conditions      []RuleBasedConditionDTO `json:"conditions"`
}

RuleBasedSegment

type RuleBasedSegmentsDTO

type RuleBasedSegmentsDTO struct {
	Since             int64                 `json:"s"`
	Till              int64                 `json:"t"`
	RuleBasedSegments []RuleBasedSegmentDTO `json:"d"`
}

type RuleChangesDTO

type RuleChangesDTO struct {
	FeatureFlags      FeatureFlagsDTO      `json:"ff"`
	RuleBasedSegments RuleBasedSegmentsDTO `json:"rbs"`
}

RuleChangesDTO structure to map JSON message sent by Split servers.

type SSESyncEvent

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

SSESyncEvent represents an SSE Sync event with only id (used for resuming connections)

func (*SSESyncEvent) EventType

func (e *SSESyncEvent) EventType() string

EventType always returns SSEEventTypeSync for SSESyncEvents

func (*SSESyncEvent) String

func (e *SSESyncEvent) String() string

String returns the string represenation of the event

func (*SSESyncEvent) Timestamp

func (e *SSESyncEvent) Timestamp() int64

Timestamp returns the timestamp of the event parsing

type Segment

type Segment struct {
	Name string `json:"n"`
}

Segment struct

type SegmentChangeUpdate

type SegmentChangeUpdate struct {
	BaseUpdate
	// contains filtered or unexported fields
}

SegmentChangeUpdate represents a segment change notification generated in the split servers.

func NewSegmentChangeUpdate

func NewSegmentChangeUpdate(baseUpdate BaseUpdate, segmentName string) *SegmentChangeUpdate

func (*SegmentChangeUpdate) SegmentName

func (u *SegmentChangeUpdate) SegmentName() string

SegmentName returns the name of the updated segment

func (*SegmentChangeUpdate) String

func (u *SegmentChangeUpdate) String() string

String returns the string representation of a segment update notification

func (*SegmentChangeUpdate) UpdateType

func (u *SegmentChangeUpdate) UpdateType() string

UpdateType is always UpdateTypeSegmentChange for Segmet Updates

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 SplitChangeUpdate

type SplitChangeUpdate struct {
	BaseUpdate
	// contains filtered or unexported fields
}

SplitChangeUpdate represents a SplitChange notification generated in the split servers

func NewRuleBasedSegmentChangeUpdate

func NewRuleBasedSegmentChangeUpdate(baseUpdate BaseUpdate, pcn *int64, ruleBasedSegment *RuleBasedSegmentDTO) *SplitChangeUpdate

func NewSplitChangeUpdate

func NewSplitChangeUpdate(baseUpdate BaseUpdate, pcn *int64, featureFlag *SplitDTO) *SplitChangeUpdate

func (*SplitChangeUpdate) FeatureFlag

func (u *SplitChangeUpdate) FeatureFlag() *SplitDTO

FeatureFlag returns feature flag definiiton or nil

func (*SplitChangeUpdate) PreviousChangeNumber

func (u *SplitChangeUpdate) PreviousChangeNumber() *int64

PreviousChangeNumber returns previous change number

func (*SplitChangeUpdate) RuleBasedSegment

func (u *SplitChangeUpdate) RuleBasedSegment() *RuleBasedSegmentDTO

GetRuleBased returns rule-based segment

func (*SplitChangeUpdate) String

func (u *SplitChangeUpdate) String() string

String returns the String representation of a split change notification

func (*SplitChangeUpdate) UpdateType

func (u *SplitChangeUpdate) UpdateType() string

UpdateType returns the type of update

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"`
	Sets                  []string          `json:"sets"`
	ImpressionsDisabled   bool              `json:"impressionsDisabled"`
	Prerequisites         []Prerequisite    `json:"prerequisites"`
}

SplitDTO structure to map an Split definition fetched from JSON message.

func (SplitDTO) MarshalBinary

func (s SplitDTO) MarshalBinary() (data []byte, err error)

MarshalBinary exports SplitDTO to JSON string

type SplitKillUpdate

type SplitKillUpdate struct {
	BaseUpdate
	// contains filtered or unexported fields
}

SplitKillUpdate represents a SplitKill notification generated in the split servers

func NewSplitKillUpdate

func NewSplitKillUpdate(baseUpdate BaseUpdate, splitName string, defaultTreatment string) *SplitKillUpdate

func (*SplitKillUpdate) DefaultTreatment

func (u *SplitKillUpdate) DefaultTreatment() string

DefaultTreatment returns the last default treatment seen in the split servers for this split

func (*SplitKillUpdate) SplitName

func (u *SplitKillUpdate) SplitName() string

SplitName returns the name of the killed split

func (*SplitKillUpdate) String

func (u *SplitKillUpdate) String() string

String returns the string representation of this update

func (*SplitKillUpdate) ToSplitChangeUpdate

func (u *SplitKillUpdate) ToSplitChangeUpdate() *SplitChangeUpdate

ToSplitChangeUpdate Maps this kill notification to a split change one

func (*SplitKillUpdate) UpdateType

func (u *SplitKillUpdate) UpdateType() string

UpdateType always returns UpdateTypeSplitKill for SplitKillUpdate messages

type Stats

type Stats struct {
	LastSynchronizations *LastSynchronization `json:"lS,omitempty"`
	MethodLatencies      *MethodLatencies     `json:"mL,omitempty"`
	MethodExceptions     *MethodExceptions    `json:"mE,omitempty"`
	HTTPErrors           *HTTPErrors          `json:"hE,omitempty"`
	HTTPLatencies        *HTTPLatencies       `json:"hL,omitempty"`
	TokenRefreshes       int64                `json:"tR,omitempty"`
	AuthRejections       int64                `json:"aR,omitempty"`
	ImpressionsQueued    int64                `json:"iQ,omitempty"`
	ImpressionsDeduped   int64                `json:"iDe,omitempty"`
	ImpressionsDropped   int64                `json:"iDr,omitempty"`
	SplitCount           int64                `json:"spC,omitempty"`
	SegmentCount         int64                `json:"seC,omitempty"`
	SegmentKeyCount      int64                `json:"skC,omitempty"`
	SessionLengthMs      int64                `json:"sL,omitempty"`
	EventsQueued         int64                `json:"eQ,omitempty"`
	EventsDropped        int64                `json:"eD,omitempty"`
	StreamingEvents      []StreamingEvent     `json:"sE,omitempty"`
	Tags                 []string             `json:"t,omitempty"`
	UpdatesFromSSE       UpdatesFromSSE       `json:"ufs,omitempty"`
}

Stats data sent by sdks pereiodically

type StreamingEvent

type StreamingEvent struct {
	Type      int   `json:"e,omitempty"`
	Data      int64 `json:"d,omitempty"`
	Timestamp int64 `json:"t,omitempty"`
}

StreamingEvent struct

type TelemetryQueueObject

type TelemetryQueueObject struct {
	Metadata Metadata `json:"m"`
	Config   Config   `json:"t"`
}

TelemetryQueueObject struct mapping telemetry

type Token

type Token struct {
	Token       string `json:"token"`
	PushEnabled bool   `json:"pushEnabled"`
}

Token dto

func (*Token) CalculateNextTokenExpiration

func (t *Token) CalculateNextTokenExpiration() (time.Duration, error)

CalculateNextTokenExpiration calculates next token expiration

func (*Token) ChannelList

func (t *Token) ChannelList() ([]string, error)

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 URLOverrides

type URLOverrides struct {
	Sdk       bool `json:"s,omitempty"`
	Events    bool `json:"e,omitempty"`
	Auth      bool `json:"a,omitempty"`
	Stream    bool `json:"st,omitempty"`
	Telemetry bool `json:"t,omitempty"`
}

URLOverrides struct

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 Uniques

type Uniques struct {
	Keys []Key `json:"keys,omitempty"`
}

Uniques struct

type Update

type Update interface {
	Message
	UpdateType() string
	ChangeNumber() int64
}

Update basic interface

type UpdatesFromSSE

type UpdatesFromSSE struct {
	Splits int64 `json:"sp,omitempty"`
}

UpdatesFromSSE struct

type UserDefinedLargeSegmentMatcherDataDTO

type UserDefinedLargeSegmentMatcherDataDTO struct {
	LargeSegmentName string `json:"largeSegmentName"`
}

UserDefinedLargeSegmentMatcherDataDTO 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.

Jump to

Keyboard shortcuts

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