impl

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONTENT_TYPE      = "content-type"
	APPLICATION_JSON  = "application/json"
	HEADER_AUTH_TYPE  = "authType"
	HEADER_SDK_ID     = "sdkId"
	HEADER_SDK_SECRET = "sdkSecret"
	SDK               = "sdk"
)
View Source
const (
	EVENT_FLUSH_INTITAL_DELAY = 2
	EVENT_FLUSH_INTERVAL      = 5
	SDK_TYPE                  = "go"
)
View Source
const (
	ZER0    = 0
	DEFAULT = "default"
)
View Source
const (
	TOTAL_THREE_DECIMAL_TRAFFIC = 100000
)

Variables

View Source
var MAX_HASH_VALUE = math.Pow(2, 32)
View Source
var MILLIS_IN_EVENT_FLUSH_INTERVAL int64 = EVENT_FLUSH_INTERVAL * 60 * 1000

Functions

This section is empty.

Types

type DataPollerRequest

type DataPollerRequest struct {
	LastUpdatedOn float64 `json:"lastUpdatedOn" validate:"required"`
	Environment   string  `json:"environment" validate:"required"`
}

type DataPollerServiceImpl

type DataPollerServiceImpl struct {
	SDKConfig       *model.SDKConfig
	PollingInterval time.Duration

	Data  *dto.Data
	Cond  *sync.Cond
	Mutex *sync.Mutex
	// contains filtered or unexported fields
}

func NewDataPollerService

func NewDataPollerService(sdkConfig *model.SDKConfig, pollingInterval time.Duration, logger *logger.Log, config *config.Store,
	client *http.Client, data *dto.Data) *DataPollerServiceImpl

func (*DataPollerServiceImpl) Start

func (dps *DataPollerServiceImpl) Start(ctx context.Context)

func (*DataPollerServiceImpl) WaitForInitializationComplete

func (dps *DataPollerServiceImpl) WaitForInitializationComplete()

type EventServiceImpl

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

func NewEventService

func NewEventService(logger *logger.Log, sdkConfig *model.SDKConfig, client *http.Client, config *config.Store) *EventServiceImpl

func (*EventServiceImpl) AddCodeBugsCount added in v1.0.4

func (es *EventServiceImpl) AddCodeBugsCount(flagId string, variantKey string)

func (*EventServiceImpl) AddErrorsCount

func (es *EventServiceImpl) AddErrorsCount(flagId string)

func (*EventServiceImpl) AddEvaluationCount

func (es *EventServiceImpl) AddEvaluationCount(flagId string, variantKey string)

func (*EventServiceImpl) Run

func (es *EventServiceImpl) Run(ctx context.Context)

func (*EventServiceImpl) SendEvents

func (es *EventServiceImpl) SendEvents(ctx context.Context, requestBody VariantsRequest)

func (*EventServiceImpl) ShutdownHook

func (es *EventServiceImpl) ShutdownHook(ctx context.Context)

func (*EventServiceImpl) Start

func (es *EventServiceImpl) Start(ctx context.Context)

type FlagsenseServiceImpl

type FlagsenseServiceImpl struct {
	SDKConfig          *model.SDKConfig
	Data               *dto.Data
	DataPollerService  services.DataPollerService
	UserVariantService services.UserVariantService
	EventService       services.EventService
	// contains filtered or unexported fields
}

func NewFlagsenseService

func NewFlagsenseService(sdkId string, sdkSecret string, environment *enums.Environment) *FlagsenseServiceImpl

func (*FlagsenseServiceImpl) BooleanVariation

func (fs *FlagsenseServiceImpl) BooleanVariation(fsFlag model.FSFlag, user model.FSUser) model.FSVariation

func (*FlagsenseServiceImpl) Close

func (fs *FlagsenseServiceImpl) Close()

func (*FlagsenseServiceImpl) DecimalVariation

func (fs *FlagsenseServiceImpl) DecimalVariation(fsFlag model.FSFlag, user model.FSUser) model.FSVariation

func (*FlagsenseServiceImpl) InitializationComplete

func (fs *FlagsenseServiceImpl) InitializationComplete() bool

func (*FlagsenseServiceImpl) IntegerVariation

func (fs *FlagsenseServiceImpl) IntegerVariation(fsFlag model.FSFlag, user model.FSUser) model.FSVariation

func (*FlagsenseServiceImpl) MapVariation

func (fs *FlagsenseServiceImpl) MapVariation(fsFlag model.FSFlag, user model.FSUser) model.FSVariation

func (*FlagsenseServiceImpl) RecordCodeError added in v1.0.4

func (fs *FlagsenseServiceImpl) RecordCodeError(flagId string, variationKey string)

func (*FlagsenseServiceImpl) StringVariation

func (fs *FlagsenseServiceImpl) StringVariation(fsFlag model.FSFlag, user model.FSUser) model.FSVariation

func (*FlagsenseServiceImpl) WaitForInitializationComplete

func (fs *FlagsenseServiceImpl) WaitForInitializationComplete()

type UserVariantServiceImpl

type UserVariantServiceImpl struct {
	Data *dto.Data
	// contains filtered or unexported fields
}

func NewUserVariantService

func NewUserVariantService(data *dto.Data, logger *logger.Log) *UserVariantServiceImpl

func (*UserVariantServiceImpl) GetUserVariant

func (uvs *UserVariantServiceImpl) GetUserVariant(userVariantDTO *dto.UserVariantDTO) error

type VariantsRequest

type VariantsRequest struct {
	MachineId   string                 `json:"machineId"`
	SdkType     string                 `json:"sdkType"`
	Environment string                 `json:"environment"`
	Data        map[string]interface{} `json:"data"`
	CodeBugs    map[string]interface{} `json:"codeBugs"`
	Errors      map[string]interface{} `json:"errors"`
	Time        int64                  `json:"time"`
}

Jump to

Keyboard shortcuts

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