assignments_managers

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynamoManager added in v0.2.0

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

func InitDynamoManager added in v0.2.0

func InitDynamoManager(options DynamoManagerOptions) *DynamoManager

func (*DynamoManager) LoadAssignments added in v0.2.0

func (d *DynamoManager) LoadAssignments(envID string, visitorID string) (*common.VisitorAssignments, error)

LoadAssignments gets all the visitor cache assignments for a specific env ID and visitor ID

func (*DynamoManager) SaveAssignments added in v0.2.0

func (d *DynamoManager) SaveAssignments(envID string, visitorID string, vgIDAssignments map[string]*common.VisitorCache, date time.Time) error

SaveAssignments saves all visitor new assignments into dynamo table

func (*DynamoManager) ShouldSaveAssignments added in v0.2.0

func (d *DynamoManager) ShouldSaveAssignments(context connectors.SaveAssignmentsContext) bool

type DynamoManagerOptions added in v0.2.0

type DynamoManagerOptions struct {
	Client              dynamodbiface.DynamoDBAPI
	TableName           string
	PrimaryKeySeparator string
	PrimaryKeyField     string
	GetItemTimeout      time.Duration
	LogLevel            string
	LogFormat           logger.LogFormat
}

type EmptyManager

type EmptyManager struct{}

func (*EmptyManager) LoadAssignments

func (*EmptyManager) LoadAssignments(envID string, visitorID string) (*common.VisitorAssignments, error)

func (*EmptyManager) SaveAssignments

func (*EmptyManager) SaveAssignments(envID string, visitorID string, vgIDAssignments map[string]*common.VisitorCache, date time.Time) error

func (*EmptyManager) ShouldSaveAssignments added in v0.2.0

func (d *EmptyManager) ShouldSaveAssignments(context connectors.SaveAssignmentsContext) bool

type LocalManager

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

LocalManager represents the local db manager object

func InitLocalCacheManager

func InitLocalCacheManager(localOptions LocalOptions) (m *LocalManager, err error)

func (*LocalManager) Dispose

func (m *LocalManager) Dispose() error

Dispose frees IO resources

func (*LocalManager) LoadAssignments

func (m *LocalManager) LoadAssignments(envID string, visitorID string) (*common.VisitorAssignments, error)

LoadAssignments returns the visitor assignment in cache

func (*LocalManager) SaveAssignments

func (m *LocalManager) SaveAssignments(envID string, visitorID string, vgIDAssignments map[string]*common.VisitorCache, date time.Time) error

SaveAssignments saves the campaigns in cache for this visitor

func (*LocalManager) ShouldSaveAssignments added in v0.2.0

func (d *LocalManager) ShouldSaveAssignments(context connectors.SaveAssignmentsContext) bool

type LocalOptions

type LocalOptions struct {
	DbPath string
	// contains filtered or unexported fields
}

LocalOptions are the options necessary to make the local cache manager work

type MemoryManager

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

func InitMemoryManager

func InitMemoryManager() *MemoryManager

func (*MemoryManager) LoadAssignments

func (m *MemoryManager) LoadAssignments(envID string, visitorID string) (*common.VisitorAssignments, error)

func (*MemoryManager) SaveAssignments

func (m *MemoryManager) SaveAssignments(envID string, visitorID string, vgIDAssignments map[string]*common.VisitorCache, date time.Time) error

func (*MemoryManager) ShouldSaveAssignments added in v0.2.0

func (d *MemoryManager) ShouldSaveAssignments(context connectors.SaveAssignmentsContext) bool

type RedisManager

type RedisManager struct {
	TTL time.Duration
	// contains filtered or unexported fields
}

RedisManager represents a redis db manager object

func InitRedisManager

func InitRedisManager(options RedisOptions) (*RedisManager, error)

func (*RedisManager) LoadAssignments

func (m *RedisManager) LoadAssignments(envID string, visitorID string) (*common.VisitorAssignments, error)

Get returns the campaigns in cache for this visitor

func (*RedisManager) SaveAssignments

func (m *RedisManager) SaveAssignments(envID string, visitorID string, vgIDAssignments map[string]*common.VisitorCache, date time.Time) error

SaveAssignments saves the assignments in cache for this visitor

func (*RedisManager) ShouldSaveAssignments added in v0.2.0

func (d *RedisManager) ShouldSaveAssignments(context connectors.SaveAssignmentsContext) bool

type RedisOptions

type RedisOptions struct {
	Host      string
	Username  string
	Password  string
	TLSConfig *tls.Config
	Db        int
	LogLevel  string
	LogFormat logger.LogFormat
	TTL       time.Duration
}

RedisOptions are the options necessary to make redis cache manager work

Jump to

Keyboard shortcuts

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