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 ¶
func (u *InMemoryUserProfileService) Save(profile decision.UserProfile)
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