odp

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package odp //

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultOdpManager

type DefaultOdpManager struct {
	OdpConfig config.Config

	SegmentManager segment.Manager
	EventManager   event.Manager
	// contains filtered or unexported fields
}

DefaultOdpManager represents default implementation of odp manager

func NewOdpManager

func NewOdpManager(sdkKey string, disable bool, options ...OMOptionFunc) *DefaultOdpManager

NewOdpManager creates and returns a new instance of DefaultOdpManager.

func (*DefaultOdpManager) FetchQualifiedSegments

func (om *DefaultOdpManager) FetchQualifiedSegments(userID string, options []segment.OptimizelySegmentOption) (segments []string, err error)

FetchQualifiedSegments fetches and returns qualified segments

func (*DefaultOdpManager) IdentifyUser

func (om *DefaultOdpManager) IdentifyUser(userID string)

IdentifyUser associates a full-stack userid with an established VUID

func (*DefaultOdpManager) SendOdpEvent

func (om *DefaultOdpManager) SendOdpEvent(eventType, action string, identifiers map[string]string, data map[string]interface{}) (err error)

SendOdpEvent sends an event to the ODP server.

func (*DefaultOdpManager) Update

func (om *DefaultOdpManager) Update(apiKey, apiHost string, segmentsToCheck []string)

Update updates odp config.

type Manager

type Manager interface {
	FetchQualifiedSegments(userID string, options []segment.OptimizelySegmentOption) (segments []string, err error)
	IdentifyUser(userID string)
	SendOdpEvent(eventType, action string, identifiers map[string]string, data map[string]interface{}) (err error)
	Update(apiKey, apiHost string, segmentsToCheck []string)
}

Manager represents the odp manager.

type OMOptionFunc

type OMOptionFunc func(em *DefaultOdpManager)

OMOptionFunc are the ODPManager options that give you the ability to add one more more options before the odp manager is initialized.

func WithEventManager

func WithEventManager(eventManager event.Manager) OMOptionFunc

WithEventManager sets eventManager option to be passed into the NewOdpManager method

func WithSegmentManager

func WithSegmentManager(segmentManager segment.Manager) OMOptionFunc

WithSegmentManager sets segmentManager option to be passed into the NewOdpManager method

func WithSegmentsCache

func WithSegmentsCache(segmentsCache cache.Cache) OMOptionFunc

WithSegmentsCache sets cache option to be passed into the NewOdpManager method

func WithSegmentsCacheSize

func WithSegmentsCacheSize(segmentsCacheSize int) OMOptionFunc

WithSegmentsCacheSize sets segmentsCacheSize option to be passed into the NewOdpManager method.

func WithSegmentsCacheTimeout

func WithSegmentsCacheTimeout(segmentsCacheTimeout time.Duration) OMOptionFunc

WithSegmentsCacheTimeout sets segmentsCacheTimeout option to be passed into the NewOdpManager method

Directories

Path Synopsis
Package cache //
Package cache //
Package config //
Package config //
Package event //
Package event //
Package segment //
Package segment //
Package utils //
Package utils //

Jump to

Keyboard shortcuts

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