Documentation
¶
Overview ¶
* DevCycle Bucketing API * * Documents the DevCycle Bucketing API which provides and API interface to User Bucketing and for generated SDKs. * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
* DevCycle Bucketing API * * Documents the DevCycle Bucketing API which provides and API interface to User Bucketing and for generated SDKs. * * API version: 1.0.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
Index ¶
- Constants
- Variables
- func GeneratePlatformData() *api.PlatformData
- func SetLogger(log Logger)
- type APIKey
- type APIResponse
- type AdvancedOptions
- type BaseVariable
- type BasicAuth
- type BatchEventsBody
- type BucketedUserConfig
- type BucketingPool
- func (p *BucketingPool) Close()
- func (p *BucketingPool) ProcessAll(operationName string, process func(object *BucketingPoolObject) error) (err error)
- func (p *BucketingPool) SetClientCustomData(customData []byte) error
- func (p *BucketingPool) StoreConfig(config []byte) error
- func (p *BucketingPool) VariableForUser(paramsBuffer []byte) (*proto.SDKVariable_PB, error)
- type BucketingPoolFactory
- func (f *BucketingPoolFactory) ActivateObject(ctx context.Context, object *pool.PooledObject) error
- func (f *BucketingPoolFactory) DestroyObject(ctx context.Context, object *pool.PooledObject) error
- func (f *BucketingPoolFactory) MakeObject(ctx context.Context) (*pool.PooledObject, error)
- func (f *BucketingPoolFactory) PassivateObject(ctx context.Context, object *pool.PooledObject) error
- func (f *BucketingPoolFactory) ValidateObject(ctx context.Context, object *pool.PooledObject) bool
- type BucketingPoolObject
- func (o *BucketingPoolObject) FlushEvents() ([]FlushPayload, error)
- func (o *BucketingPoolObject) HandleFlushResults(result *FlushResult)
- func (o *BucketingPoolObject) Initialize(wasmMain *WASMMain, sdkKey string, platformData *PlatformData, ...) (err error)
- func (o *BucketingPoolObject) SetClientCustomData(clientCustomData *[]byte) (err error)
- func (o *BucketingPoolObject) StoreConfig(config *[]byte) (err error)
- type ConfigReceiver
- type DVCClient
- func (c *DVCClient) AllFeatures(user DVCUser) (map[string]Feature, error)
- func (c *DVCClient) AllVariables(user DVCUser) (map[string]ReadOnlyVariable, error)
- func (c *DVCClient) ChangeBasePath(path string)
- func (c *DVCClient) Close() (err error)
- func (c *DVCClient) FlushEvents() error
- func (c *DVCClient) SetClientCustomData(customData map[string]interface{}) error
- func (c *DVCClient) SetOptions(dvcOptions DVCOptions)
- func (c *DVCClient) Track(user DVCUser, event DVCEvent) (bool, error)
- func (c *DVCClient) Variable(userdata DVCUser, key string, defaultValue interface{}) (result Variable, err error)
- type DVCEvent
- type DVCOptions
- type DVCPopulatedUser
- type DVCUser
- type DiscardLogger
- type EdgeDBSettings
- type Environment
- type EnvironmentConfigManager
- type ErrorResponse
- type EventQueue
- type EventQueueOptions
- type EventQueuer
- type Feature
- type FeatureVariation
- type FlushPayload
- type FlushResult
- type GenericError
- type HTTPConfiguration
- type LocalBucketing
- type Logger
- type OptInColors
- type OptInSettings
- type PlatformData
- type Project
- type ProjectSettings
- type ReadOnlyVariable
- type SDKEvent
- type UserDataAndEventsBody
- type UserEventsBatchRecord
- type UserFeatureData
- type Variable
- type VariableTypeCode
- type VariableTypeCodes
- type WASMLocalBucketing
- func (lb *WASMLocalBucketing) Close()
- func (lb *WASMLocalBucketing) GenerateBucketedConfigForUser(user DVCUser) (ret *BucketedUserConfig, err error)
- func (lb *WASMLocalBucketing) SetClientCustomData(customData map[string]interface{}) error
- func (lb *WASMLocalBucketing) StoreConfig(config []byte, eTag string) error
- func (lb *WASMLocalBucketing) Variable(user DVCUser, key string, variableType string) (variable Variable, err error)
- type WASMLocalBucketingClient
- func (d *WASMLocalBucketingClient) GenerateBucketedConfigForUser(user DVCUser) (ret *BucketedUserConfig, err error)
- func (d *WASMLocalBucketingClient) HandleFlushResults(result *FlushResult)
- func (d *WASMLocalBucketingClient) Initialize(wasmMain *WASMMain, sdkKey string, platformData *PlatformData, ...) (err error)
- func (d *WASMLocalBucketingClient) OnPayloadFailure(payloadId string, retryable bool) (err error)
- func (d *WASMLocalBucketingClient) OnPayloadSuccess(payloadId string) (err error)
- func (d *WASMLocalBucketingClient) SetClientCustomData(customData []byte) error
- func (d *WASMLocalBucketingClient) SetPlatformDataJSON(platformData []byte) error
- func (d *WASMLocalBucketingClient) StoreConfig(config []byte) error
- func (d *WASMLocalBucketingClient) VariableForUser_PB(serializedParams []byte) (*proto.SDKVariable_PB, error)
- func (c *WASMLocalBucketingClient) VariableTypeCodeFromType(varType string) (varTypeCode VariableTypeCode, err error)
- type WASMMain
Constants ¶
const CONFIG_RETRIES = 1
const NATIVE_SDK = false
const VERSION = "2.9.6"
Variables ¶
var ( // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. ContextOAuth2 = contextKey("token") // ContextBasicAuth takes BasicAuth as authentication for the request. ContextBasicAuth = contextKey("basic") // ContextAccessToken takes a string oauth2 access token as authentication for the request. ContextAccessToken = contextKey("accesstoken") // ContextAPIKey takes an APIKey as authentication for the request ContextAPIKey = contextKey("apikey") )
Functions ¶
func GeneratePlatformData ¶ added in v2.9.5
func GeneratePlatformData() *api.PlatformData
Types ¶
type APIKey ¶
APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIResponse ¶
type APIResponse struct { *http.Response `json:"-"` Message string `json:"message,omitempty"` // Operation is the name of the swagger operation. Operation string `json:"operation,omitempty"` // RequestURL is the request URL. This value is always available, even if the // embedded *http.Response is nil. RequestURL string `json:"url,omitempty"` // Method is the HTTP method used for the request. This value is always // available, even if the embedded *http.Response is nil. Method string `json:"method,omitempty"` // Payload holds the contents of the response body (which may be nil or empty). // This is provided here as the raw response.Body() reader will have already // been drained. Payload []byte `json:"-"` }
func NewAPIResponse ¶
func NewAPIResponse(r *http.Response) *APIResponse
func NewAPIResponseWithError ¶
func NewAPIResponseWithError(errorMessage string) *APIResponse
type AdvancedOptions ¶ added in v2.7.0
type AdvancedOptions struct { // controls the maximum number of pre-allocated memory blocks used for WASM execution. This influences the maximum // string length that can be fit inside of preallocated memory // Can be set to -1 to disable pre-allocated memory blocks entirely. // This takes \sum_{k=5}^{n+5} 2^k memory usage MaxMemoryAllocationBuckets int MaxWasmWorkers int }
type BaseVariable ¶ added in v2.9.5
type BaseVariable = api.BaseVariable
type BasicAuth ¶
type BasicAuth struct { UserName string `json:"userName,omitempty"` Password string `json:"password,omitempty"` }
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
type BatchEventsBody ¶
type BatchEventsBody = api.BatchEventsBody
type BucketedUserConfig ¶
type BucketedUserConfig = api.BucketedUserConfig
type BucketingPool ¶ added in v2.9.0
type BucketingPool struct {
// contains filtered or unexported fields
}
func NewBucketingPool ¶ added in v2.9.0
func NewBucketingPool(ctx context.Context, wasmMain *WASMMain, sdkKey string, platformData *PlatformData, options *DVCOptions) (*BucketingPool, error)
func (*BucketingPool) Close ¶ added in v2.9.0
func (p *BucketingPool) Close()
func (*BucketingPool) ProcessAll ¶ added in v2.9.0
func (p *BucketingPool) ProcessAll( operationName string, process func(object *BucketingPoolObject) error, ) (err error)
ProcessAll will func the "process" handler function on every object in the pool. It will block until the operation has completed for every object, or there was an error. It naively grabs the longest idle object from the pool each time and checks if it has seen it before. If it has, it will immediately return it and try again.
func (*BucketingPool) SetClientCustomData ¶ added in v2.9.0
func (p *BucketingPool) SetClientCustomData(customData []byte) error
func (*BucketingPool) StoreConfig ¶ added in v2.9.4
func (p *BucketingPool) StoreConfig(config []byte) error
func (*BucketingPool) VariableForUser ¶ added in v2.9.0
func (p *BucketingPool) VariableForUser(paramsBuffer []byte) (*proto.SDKVariable_PB, error)
type BucketingPoolFactory ¶ added in v2.9.0
type BucketingPoolFactory struct {
// contains filtered or unexported fields
}
func MakeBucketingPoolFactory ¶ added in v2.9.0
func MakeBucketingPoolFactory(wasmMain *WASMMain, sdkKey string, platformData *PlatformData, options *DVCOptions, pool *BucketingPool) *BucketingPoolFactory
func (*BucketingPoolFactory) ActivateObject ¶ added in v2.9.0
func (f *BucketingPoolFactory) ActivateObject(ctx context.Context, object *pool.PooledObject) error
func (*BucketingPoolFactory) DestroyObject ¶ added in v2.9.0
func (f *BucketingPoolFactory) DestroyObject(ctx context.Context, object *pool.PooledObject) error
func (*BucketingPoolFactory) MakeObject ¶ added in v2.9.0
func (f *BucketingPoolFactory) MakeObject(ctx context.Context) (*pool.PooledObject, error)
func (*BucketingPoolFactory) PassivateObject ¶ added in v2.9.0
func (f *BucketingPoolFactory) PassivateObject(ctx context.Context, object *pool.PooledObject) error
func (*BucketingPoolFactory) ValidateObject ¶ added in v2.9.0
func (f *BucketingPoolFactory) ValidateObject(ctx context.Context, object *pool.PooledObject) bool
type BucketingPoolObject ¶ added in v2.9.0
type BucketingPoolObject struct {
// contains filtered or unexported fields
}
func (*BucketingPoolObject) FlushEvents ¶ added in v2.9.0
func (o *BucketingPoolObject) FlushEvents() ([]FlushPayload, error)
func (*BucketingPoolObject) HandleFlushResults ¶ added in v2.9.0
func (o *BucketingPoolObject) HandleFlushResults(result *FlushResult)
func (*BucketingPoolObject) Initialize ¶ added in v2.9.0
func (o *BucketingPoolObject) Initialize(wasmMain *WASMMain, sdkKey string, platformData *PlatformData, options *DVCOptions) (err error)
func (*BucketingPoolObject) SetClientCustomData ¶ added in v2.9.0
func (o *BucketingPoolObject) SetClientCustomData(clientCustomData *[]byte) (err error)
func (*BucketingPoolObject) StoreConfig ¶ added in v2.9.0
func (o *BucketingPoolObject) StoreConfig(config *[]byte) (err error)
type ConfigReceiver ¶ added in v2.9.4
type DVCClient ¶
type DVCClient struct { DevCycleOptions *DVCOptions // contains filtered or unexported fields }
DVCClient In most cases there should be only one, shared, DVCClient.
func NewDVCClient ¶
func NewDVCClient(sdkKey string, options *DVCOptions) (*DVCClient, error)
NewDVCClient creates a new API client. optionally pass a custom http.Client to allow for advanced features such as caching.
func (*DVCClient) AllFeatures ¶
DVCClientService Get all features by key for user data
- @param body
@return map[string]Feature
func (*DVCClient) AllVariables ¶
func (c *DVCClient) AllVariables(user DVCUser) (map[string]ReadOnlyVariable, error)
func (*DVCClient) ChangeBasePath ¶
Change base path to allow switching to mocks
func (*DVCClient) FlushEvents ¶
func (*DVCClient) SetClientCustomData ¶ added in v2.2.0
func (*DVCClient) SetOptions ¶
func (c *DVCClient) SetOptions(dvcOptions DVCOptions)
type DVCOptions ¶
type DVCOptions struct { EnableEdgeDB bool `json:"enableEdgeDb,omitempty"` EnableCloudBucketing bool `json:"enableCloudBucketing,omitempty"` EventFlushIntervalMS time.Duration `json:"eventFlushIntervalMS,omitempty"` ConfigPollingIntervalMS time.Duration `json:"configPollingIntervalMS,omitempty"` RequestTimeout time.Duration `json:"requestTimeout,omitempty"` DisableAutomaticEventLogging bool `json:"disableAutomaticEventLogging,omitempty"` DisableCustomEventLogging bool `json:"disableCustomEventLogging,omitempty"` MaxEventQueueSize int `json:"maxEventsPerFlush,omitempty"` FlushEventQueueSize int `json:"minEventsPerFlush,omitempty"` ConfigCDNURI string EventsAPIURI string OnInitializedChannel chan bool BucketingAPIURI string Logger util.Logger UseDebugWASM bool AdvancedOptions }
func (*DVCOptions) CheckDefaults ¶
func (o *DVCOptions) CheckDefaults()
type DVCPopulatedUser ¶ added in v2.9.5
type DVCPopulatedUser = api.DVCPopulatedUser
type DiscardLogger ¶ added in v2.3.0
type DiscardLogger = util.DiscardLogger
type EdgeDBSettings ¶
type EdgeDBSettings = api.EdgeDBSettings
type Environment ¶
type Environment = api.Environment
type EnvironmentConfigManager ¶
type EnvironmentConfigManager struct {
// contains filtered or unexported fields
}
func NewEnvironmentConfigManager ¶ added in v2.9.4
func NewEnvironmentConfigManager( sdkKey string, localBucketing ConfigReceiver, options *DVCOptions, cfg *HTTPConfiguration, ) (e *EnvironmentConfigManager)
func (*EnvironmentConfigManager) Close ¶
func (e *EnvironmentConfigManager) Close()
func (*EnvironmentConfigManager) HasConfig ¶
func (e *EnvironmentConfigManager) HasConfig() bool
func (*EnvironmentConfigManager) StartPolling ¶ added in v2.9.4
func (e *EnvironmentConfigManager) StartPolling( interval time.Duration, )
type ErrorResponse ¶
type ErrorResponse = api.ErrorResponse
type EventQueue ¶
type EventQueue struct {
// contains filtered or unexported fields
}
func (*EventQueue) Close ¶
func (e *EventQueue) Close() (err error)
func (*EventQueue) FlushEvents ¶
func (e *EventQueue) FlushEvents() (err error)
func (*EventQueue) Metrics ¶ added in v2.8.0
func (e *EventQueue) Metrics() (int32, int32)
func (*EventQueue) QueueAggregateEvent ¶
func (e *EventQueue) QueueAggregateEvent(config BucketedUserConfig, event DVCEvent) error
func (*EventQueue) QueueEvent ¶
func (e *EventQueue) QueueEvent(user DVCUser, event DVCEvent) error
type EventQueueOptions ¶
type EventQueueOptions = api.EventQueueOptions
type EventQueuer ¶ added in v2.9.5
type FeatureVariation ¶
type FeatureVariation = api.FeatureVariation
type FlushPayload ¶
type FlushPayload = api.FlushPayload
type FlushResult ¶ added in v2.8.0
type GenericError ¶
type GenericError struct {
// contains filtered or unexported fields
}
GenericError Provides access to the body, error and model on returned errors.
func (GenericError) Body ¶
func (e GenericError) Body() []byte
Body returns the raw bytes of the response
func (GenericError) Error ¶
func (e GenericError) Error() string
Error returns non-empty string if there was an error.
func (GenericError) Model ¶
func (e GenericError) Model() interface{}
Model returns the unpacked model of the error
type HTTPConfiguration ¶
type HTTPConfiguration struct { BasePath string `json:"basePath,omitempty"` ConfigCDNBasePath string `json:"configCDNBasePath,omitempty"` EventsAPIBasePath string `json:"eventsAPIBasePath,omitempty"` Host string `json:"host,omitempty"` Scheme string `json:"scheme,omitempty"` DefaultHeader map[string]string `json:"defaultHeader,omitempty"` UserAgent string `json:"userAgent,omitempty"` HTTPClient *http.Client }
func NewConfiguration ¶
func NewConfiguration(options *DVCOptions) *HTTPConfiguration
func (*HTTPConfiguration) AddDefaultHeader ¶
func (c *HTTPConfiguration) AddDefaultHeader(key string, value string)
type LocalBucketing ¶ added in v2.9.5
type OptInColors ¶
type OptInColors = api.OptInColors
type OptInSettings ¶
type OptInSettings = api.OptInSettings
type PlatformData ¶
type PlatformData = api.PlatformData
type ProjectSettings ¶
type ProjectSettings = api.ProjectSettings
type ReadOnlyVariable ¶
type ReadOnlyVariable = api.ReadOnlyVariable
type UserDataAndEventsBody ¶
type UserDataAndEventsBody = api.UserDataAndEventsBody
type UserEventsBatchRecord ¶
type UserEventsBatchRecord = api.UserEventsBatchRecord
type UserFeatureData ¶
type UserFeatureData = api.UserFeatureData
type VariableTypeCode ¶ added in v2.6.0
type VariableTypeCode int32
type VariableTypeCodes ¶ added in v2.6.0
type VariableTypeCodes struct { Boolean VariableTypeCode Number VariableTypeCode String VariableTypeCode JSON VariableTypeCode }
type WASMLocalBucketing ¶ added in v2.9.5
type WASMLocalBucketing struct {
// contains filtered or unexported fields
}
func NewWASMLocalBucketing ¶ added in v2.9.5
func NewWASMLocalBucketing(sdkKey string, platformData *PlatformData, options *DVCOptions) (*WASMLocalBucketing, error)
func (*WASMLocalBucketing) Close ¶ added in v2.9.5
func (lb *WASMLocalBucketing) Close()
func (*WASMLocalBucketing) GenerateBucketedConfigForUser ¶ added in v2.9.5
func (lb *WASMLocalBucketing) GenerateBucketedConfigForUser(user DVCUser) (ret *BucketedUserConfig, err error)
func (*WASMLocalBucketing) SetClientCustomData ¶ added in v2.9.5
func (lb *WASMLocalBucketing) SetClientCustomData(customData map[string]interface{}) error
func (*WASMLocalBucketing) StoreConfig ¶ added in v2.9.5
func (lb *WASMLocalBucketing) StoreConfig(config []byte, eTag string) error
type WASMLocalBucketingClient ¶ added in v2.9.5
type WASMLocalBucketingClient struct { VariableTypeCodes VariableTypeCodes // contains filtered or unexported fields }
func (*WASMLocalBucketingClient) GenerateBucketedConfigForUser ¶ added in v2.9.5
func (d *WASMLocalBucketingClient) GenerateBucketedConfigForUser(user DVCUser) (ret *BucketedUserConfig, err error)
func (*WASMLocalBucketingClient) HandleFlushResults ¶ added in v2.9.5
func (d *WASMLocalBucketingClient) HandleFlushResults(result *FlushResult)
func (*WASMLocalBucketingClient) Initialize ¶ added in v2.9.5
func (d *WASMLocalBucketingClient) Initialize(wasmMain *WASMMain, sdkKey string, platformData *PlatformData, options *DVCOptions) (err error)
func (*WASMLocalBucketingClient) OnPayloadFailure ¶ added in v2.9.5
func (d *WASMLocalBucketingClient) OnPayloadFailure(payloadId string, retryable bool) (err error)
func (*WASMLocalBucketingClient) OnPayloadSuccess ¶ added in v2.9.5
func (d *WASMLocalBucketingClient) OnPayloadSuccess(payloadId string) (err error)
func (*WASMLocalBucketingClient) SetClientCustomData ¶ added in v2.9.5
func (d *WASMLocalBucketingClient) SetClientCustomData(customData []byte) error
func (*WASMLocalBucketingClient) SetPlatformDataJSON ¶ added in v2.9.5
func (d *WASMLocalBucketingClient) SetPlatformDataJSON(platformData []byte) error
func (*WASMLocalBucketingClient) StoreConfig ¶ added in v2.9.5
func (d *WASMLocalBucketingClient) StoreConfig(config []byte) error
func (*WASMLocalBucketingClient) VariableForUser_PB ¶ added in v2.9.5
func (d *WASMLocalBucketingClient) VariableForUser_PB(serializedParams []byte) (*proto.SDKVariable_PB, error)
* This is a helper function to call the variableForUserPB function in the WASM module. * It takes a serialized protobuf message as input and returns a serialized protobuf message as output.
func (*WASMLocalBucketingClient) VariableTypeCodeFromType ¶ added in v2.9.5
func (c *WASMLocalBucketingClient) VariableTypeCodeFromType(varType string) (varTypeCode VariableTypeCode, err error)
type WASMMain ¶ added in v2.7.0
type WASMMain struct {
// contains filtered or unexported fields
}
func (*WASMMain) Initialize ¶ added in v2.7.0
func (d *WASMMain) Initialize(options *DVCOptions) (err error)
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
* DevCycle Bucketing API * * Documents the DevCycle Bucketing API which provides and API interface to User Bucketing and for generated SDKs.
|
* DevCycle Bucketing API * * Documents the DevCycle Bucketing API which provides and API interface to User Bucketing and for generated SDKs. |
example
|
|
cloud
command
|
|
local
command
|
|