servicedef

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package servicedef contains definitions for the REST protocol that test services must implement. See the top-level README.md for more details.

The package is used by the test harness, but can also be imported by any test service code that is Go-based.

Index

Constants

View Source
const (
	CommandEvaluateFlag             = "evaluate"
	CommandEvaluateAllFlags         = "evaluateAll"
	CommandIdentifyEvent            = "identifyEvent"
	CommandCustomEvent              = "customEvent"
	CommandAliasEvent               = "aliasEvent"
	CommandFlushEvents              = "flushEvents"
	CommandGetBigSegmentStoreStatus = "getBigSegmentStoreStatus"
	CommandSecureModeHash           = "secureModeHash"
)
View Source
const (
	ValueTypeBool   = "bool"
	ValueTypeInt    = "int"
	ValueTypeDouble = "double"
	ValueTypeString = "string"
	ValueTypeAny    = "any"
)
View Source
const (
	CapabilityClientSide    = "client-side"
	CapabilityServerSide    = "server-side"
	CapabilityStronglyTyped = "strongly-typed"
	CapabilityMobile        = "mobile"
	CapabilityPHP           = "php"
	CapabilityRoku          = "roku"
	CapabilitySingleton     = "singleton"

	CapabilityAllFlagsWithReasons                = "all-flags-with-reasons"
	CapabilityAllFlagsClientSideOnly             = "all-flags-client-side-only"
	CapabilityAllFlagsDetailsOnlyForTrackedFlags = "all-flags-details-only-for-tracked-flags"

	CapabilityBigSegments       = "big-segments"
	CapabilitySecureModeHash    = "secure-mode-hash"
	CapabilityServerSidePolling = "server-side-polling"
	CapabilityServiceEndpoints  = "service-endpoints"
	CapabilityTags              = "tags"
	CapabilityFiltering         = "filtering"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AliasEventParams

type AliasEventParams struct {
	User         lduser.User `json:"user"`
	PreviousUser lduser.User `json:"previousUser"`
}

type BigSegmentStoreStatusResponse added in v1.1.0

type BigSegmentStoreStatusResponse struct {
	Available bool `json:"available"`
	Stale     bool `json:"stale"`
}

type CommandParams

type CommandParams struct {
	Command        string                          `json:"command"`
	Evaluate       o.Maybe[EvaluateFlagParams]     `json:"evaluate,omitempty"`
	EvaluateAll    o.Maybe[EvaluateAllFlagsParams] `json:"evaluateAll,omitempty"`
	CustomEvent    o.Maybe[CustomEventParams]      `json:"customEvent,omitempty"`
	IdentifyEvent  o.Maybe[IdentifyEventParams]    `json:"identifyEvent,omitempty"`
	AliasEvent     o.Maybe[AliasEventParams]       `json:"aliasEvent,omitempty"`
	SecureModeHash o.Maybe[SecureModeHashParams]   `json:"secureModeHash,omitempty"`
}

type CreateInstanceParams

type CreateInstanceParams struct {
	Configuration SDKConfigParams `json:"configuration"`
	Tag           string          `json:"tag"`
}

type CustomEventParams

type CustomEventParams struct {
	EventKey     string               `json:"eventKey"`
	User         o.Maybe[lduser.User] `json:"user"`
	Data         ldvalue.Value        `json:"data,omitempty"`
	OmitNullData bool                 `json:"omitNullData"`
	MetricValue  o.Maybe[float64]     `json:"metricValue,omitempty"`
}

type EvaluateAllFlagsParams

type EvaluateAllFlagsParams struct {
	User                       o.Maybe[lduser.User] `json:"user,omitempty"`
	WithReasons                bool                 `json:"withReasons"`
	ClientSideOnly             bool                 `json:"clientSideOnly"`
	DetailsOnlyForTrackedFlags bool                 `json:"detailsOnlyForTrackedFlags"`
}

type EvaluateAllFlagsResponse

type EvaluateAllFlagsResponse struct {
	State map[string]ldvalue.Value `json:"state"`
}

type EvaluateFlagParams

type EvaluateFlagParams struct {
	FlagKey      string               `json:"flagKey"`
	User         o.Maybe[lduser.User] `json:"user"`
	ValueType    ValueType            `json:"valueType"`
	DefaultValue ldvalue.Value        `json:"defaultValue"`
	Detail       bool                 `json:"detail"`
}

type EvaluateFlagResponse

type EvaluateFlagResponse struct {
	Value          ldvalue.Value                      `json:"value"`
	VariationIndex o.Maybe[int]                       `json:"variationIndex,omitempty"`
	Reason         o.Maybe[ldreason.EvaluationReason] `json:"reason,omitempty"`
}

type IdentifyEventParams

type IdentifyEventParams struct {
	User lduser.User `json:"user"`
}

type SDKConfigBigSegmentsParams added in v1.1.0

type SDKConfigBigSegmentsParams struct {
	CallbackURI          string                              `json:"callbackUri"`
	UserCacheSize        o.Maybe[int]                        `json:"userCacheSize,omitempty"`
	UserCacheTimeMS      o.Maybe[ldtime.UnixMillisecondTime] `json:"userCacheTimeMs,omitempty"`
	StatusPollIntervalMS o.Maybe[ldtime.UnixMillisecondTime] `json:"statusPollIntervalMs,omitempty"`
	StaleAfterMS         o.Maybe[ldtime.UnixMillisecondTime] `json:"staleAfterMs,omitempty"`
}

type SDKConfigClientSideParams added in v1.6.0

type SDKConfigClientSideParams struct {
	InitialUser        lduser.User   `json:"initialUser"`
	AutoAliasingOptOut o.Maybe[bool] `json:"autoAliasingOptOut,omitempty"`
	EvaluationReasons  o.Maybe[bool] `json:"evaluationReasons,omitempty"`
	UseReport          o.Maybe[bool] `json:"useReport,omitempty"`
}

type SDKConfigEventParams

type SDKConfigEventParams struct {
	BaseURI                 string                              `json:"baseUri,omitempty"`
	Capacity                o.Maybe[int]                        `json:"capacity,omitempty"`
	EnableDiagnostics       bool                                `json:"enableDiagnostics"`
	AllAttributesPrivate    bool                                `json:"allAttributesPrivate,omitempty"`
	GlobalPrivateAttributes []lduser.UserAttribute              `json:"globalPrivateAttributes,omitempty"`
	FlushIntervalMS         o.Maybe[ldtime.UnixMillisecondTime] `json:"flushIntervalMs,omitempty"`
	InlineUsers             bool                                `json:"inlineUsers,omitempty"`
}

type SDKConfigParams

type SDKConfigParams struct {
	Credential          string                                      `json:"credential"`
	StartWaitTimeMS     o.Maybe[ldtime.UnixMillisecondTime]         `json:"startWaitTimeMs,omitempty"`
	InitCanFail         bool                                        `json:"initCanFail,omitempty"`
	ServiceEndpoints    o.Maybe[SDKConfigServiceEndpointsParams]    `json:"serviceEndpoints,omitempty"`
	Streaming           o.Maybe[SDKConfigStreamingParams]           `json:"streaming,omitempty"`
	Polling             o.Maybe[SDKConfigPollingParams]             `json:"polling,omitempty"`
	Events              o.Maybe[SDKConfigEventParams]               `json:"events,omitempty"`
	PersistentDataStore o.Maybe[SDKConfigPersistentDataStoreParams] `json:"persistentDataStore,omitempty"`
	BigSegments         o.Maybe[SDKConfigBigSegmentsParams]         `json:"bigSegments,omitempty"`
	Tags                o.Maybe[SDKConfigTagsParams]                `json:"tags,omitempty"`
	ClientSide          o.Maybe[SDKConfigClientSideParams]          `json:"clientSide,omitempty"`
}

type SDKConfigPersistentDataStoreParams added in v1.1.0

type SDKConfigPersistentDataStoreParams struct {
	CallbackURI string `json:"callbackURI"`
}

type SDKConfigPollingParams added in v1.6.0

type SDKConfigPollingParams struct {
	BaseURI        string                              `json:"baseUri,omitempty"`
	PollIntervalMS o.Maybe[ldtime.UnixMillisecondTime] `json:"pollIntervalMs,omitempty"`
	Filter         o.Maybe[string]                     `json:"filter,omitempty"`
}

type SDKConfigServiceEndpointsParams added in v1.5.0

type SDKConfigServiceEndpointsParams struct {
	Streaming string `json:"streaming,omitempty"`
	Polling   string `json:"polling,omitempty"`
	Events    string `json:"events,omitempty"`
}

type SDKConfigStreamingParams

type SDKConfigStreamingParams struct {
	BaseURI             string                              `json:"baseUri,omitempty"`
	InitialRetryDelayMS o.Maybe[ldtime.UnixMillisecondTime] `json:"initialRetryDelayMs,omitempty"`
	Filter              o.Maybe[string]                     `json:"filter,omitempty"`
}

type SDKConfigTagsParams added in v1.3.0

type SDKConfigTagsParams struct {
	ApplicationID      o.Maybe[string] `json:"applicationId,omitempty"`
	ApplicationVersion o.Maybe[string] `json:"applicationVersion,omitempty"`
}

type SecureModeHashParams added in v1.9.0

type SecureModeHashParams struct {
	User lduser.User `json:"user"`
}

type SecureModeHashResponse added in v1.9.0

type SecureModeHashResponse struct {
	Result string `json:"result"`
}

type StatusRep

type StatusRep struct {
	harness.TestServiceInfo
	ClientVersion string `json:"clientVersion"`
}

type ValueType

type ValueType string

Directories

Path Synopsis
Package callbackfixtures contains definitions for the REST protocol that test services must implement, specifically for callback requests from the test service to the test harness.
Package callbackfixtures contains definitions for the REST protocol that test services must implement, specifically for callback requests from the test service to the test harness.

Jump to

Keyboard shortcuts

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