assignments_managers

package
v0.0.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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, context connectors.SaveAssignmentsContext) error

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, context connectors.SaveAssignmentsContext) error

Set saves the campaigns in cache for this visitor

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, context connectors.SaveAssignmentsContext) error

type RedisManager

type RedisManager struct {
	// 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, context connectors.SaveAssignmentsContext) error

SaveAssignments saves the assignments in cache for this visitor

type RedisOptions

type RedisOptions struct {
	Host      string
	Username  string
	Password  string
	TLSConfig *tls.Config
	Db        int
	LogLevel  string
}

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