conf

package
v6.1.4-rc2 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: Apache-2.0 Imports: 11 Imported by: 15

Documentation

Overview

Package conf contains configuration structures used to setup the SDK

Index

Constants

View Source
const (
	// RedisConsumer mode
	RedisConsumer = "redis-consumer"
	// Localhost mode
	Localhost = "localhost"
	// InMemoryStandAlone mode
	InMemoryStandAlone = "inmemory-standalone"
)

Variables

This section is empty.

Functions

func Normalize

func Normalize(apikey string, cfg *SplitSdkConfig) error

Normalize checks that the parameters passed by the user are correct and updates parameters if necessary. returns an error if something is wrong

func NormalizeSDKConf

func NormalizeSDKConf(sdkConfig AdvancedConfig) conf.AdvancedConfig

NormalizeSDKConf compares against SDK Config to set defaults

Types

type AdvancedConfig

type AdvancedConfig struct {
	ImpressionListener   impressionlistener.ImpressionListener
	HTTPTimeout          int
	SegmentQueueSize     int
	SegmentWorkers       int
	AuthServiceURL       string
	SdkURL               string
	EventsURL            string
	StreamingServiceURL  string
	TelemetryServiceURL  string
	EventsBulkSize       int64
	EventsQueueSize      int
	ImpressionsQueueSize int
	ImpressionsBulkSize  int64
	StreamingEnabled     bool
}

AdvancedConfig exposes more configurable parameters that can be used to further tailor the sdk to the user's needs - ImpressionListener - struct that will be notified each time an impression bulk is ready - HTTPTimeout - Timeout for HTTP requests when doing synchronization - SegmentQueueSize - How many segments can be queued for updating (should be >= # segments the user has) - SegmentWorkers - How many workers will be used when performing segments sync.

type SplitSdkConfig

type SplitSdkConfig struct {
	OperationMode      string
	InstanceName       string
	IPAddress          string
	IPAddressesEnabled bool
	BlockUntilReady    int
	SplitFile          string
	LabelsEnabled      bool
	SplitSyncProxyURL  string
	Logger             logging.LoggerInterface
	LoggerConfig       logging.LoggerOptions
	TaskPeriods        TaskPeriods
	Advanced           AdvancedConfig
	Redis              conf.RedisConfig
	ImpressionsMode    string
}

SplitSdkConfig struct ... struct used to setup a Split.io SDK client.

Parameters: - OperationMode (Required) Must be one of ["inmemory-standalone", "redis-consumer"] - InstanceName (Optional) Name to be used when submitting metrics & impressions to split servers - IPAddress (Optional) Address to be used when submitting metrics & impressions to split servers - BlockUntilReady (Optional) How much to wait until the sdk is ready - SplitFile (Optional) File with splits to use when running in localhost mode - LabelsEnabled (Optional) Can be used to disable labels if the user does not want to send that info to split servers. - Logger: (Optional) Custom logger complying with logging.LoggerInterface - LoggerConfig: (Optional) Options to setup the sdk's own logger - TaskPeriods: (Optional) How often should each task run - Redis: (Required for "redis-consumer". Sets up Redis config - Advanced: (Optional) Sets up various advanced options for the sdk - ImpressionsMode (Optional) Flag for enabling local impressions dedupe - Possible values <'optimized'|'debug'>

func Default

func Default() *SplitSdkConfig

Default returns a config struct with all the default values

type TaskPeriods

type TaskPeriods struct {
	SplitSync      int
	SegmentSync    int
	ImpressionSync int
	GaugeSync      int
	CounterSync    int
	LatencySync    int
	EventsSync     int
	TelemetrySync  int
}

TaskPeriods struct is used to configure the period for each synchronization task

Jump to

Keyboard shortcuts

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