impl

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: Apache-2.0 Imports: 25 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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) 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) 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"`
	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