services

package
v0.0.0-...-ce409c2 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package services //

Package services //

Package services //

Package services //

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryUserProfileService

type InMemoryUserProfileService struct {
	Capacity int `json:"capacity"`
	// StorageStrategy defines the storage strategy. Supported values include fifo and lifo.
	StorageStrategy string `json:"storageStrategy"`
	ProfilesMap     map[string]decision.UserProfile
	// contains filtered or unexported fields
}

InMemoryUserProfileService represents the in-memory implementation of UserProfileService interface

func (*InMemoryUserProfileService) Lookup

func (u *InMemoryUserProfileService) Lookup(userID string) (profile decision.UserProfile)

Lookup is used to retrieve past bucketing decisions for users

func (*InMemoryUserProfileService) Save

Save is used to save bucketing decisions for users

type RedisUserProfileService

type RedisUserProfileService struct {
	Client     *redis.Client
	Expiration time.Duration
	Address    string `json:"host"`
	Password   string `json:"password"`
	Database   int    `json:"database"`
}

RedisUserProfileService represents the redis implementation of UserProfileService interface

func (*RedisUserProfileService) Lookup

func (u *RedisUserProfileService) Lookup(userID string) (profile decision.UserProfile)

Lookup is used to retrieve past bucketing decisions for users

func (*RedisUserProfileService) Save

func (u *RedisUserProfileService) Save(profile decision.UserProfile)

Save is used to save bucketing decisions for users

type RestUserProfileService

type RestUserProfileService struct {
	Requester    *utils.HTTPRequester
	Host         string            `json:"host"`
	Headers      map[string]string `json:"headers"`
	LookupPath   string            `json:"lookupPath"`
	LookupMethod string            `json:"lookupMethod"`
	SavePath     string            `json:"savePath"`
	SaveMethod   string            `json:"saveMethod"`
	UserIDKey    string            `json:"userIDKey"`
}

RestUserProfileService represents the rest API implementation of UserProfileService interface

func (*RestUserProfileService) Lookup

func (r *RestUserProfileService) Lookup(userID string) (profile decision.UserProfile)

Lookup is used to retrieve past bucketing decisions for users

func (*RestUserProfileService) Save

func (r *RestUserProfileService) Save(profile decision.UserProfile)

Save is used to save bucketing decisions for users

Jump to

Keyboard shortcuts

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