fallback

package
v2.6.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadFallbackConfig

func LoadFallbackConfig(config *recconf.RecommendConfig)

func RegisterFallback

func RegisterFallback(sceneName string, fallback IFallback)

func RemoveFallback

func RemoveFallback(sceneName string)

Types

type FallbackService

type FallbackService struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func DefaultFallbackService

func DefaultFallbackService() *FallbackService

func NewFallbackService

func NewFallbackService() *FallbackService

func (*FallbackService) AddFallback

func (r *FallbackService) AddFallback(sceneName string, fallback IFallback)

func (*FallbackService) GetFallback

func (r *FallbackService) GetFallback(sceneName string) (ret IFallback)

func (*FallbackService) RemoveFallback

func (r *FallbackService) RemoveFallback(sceneName string)

type FeatureStoreFallback

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

func NewFeatureStoreFallback

func NewFeatureStoreFallback(conf recconf.FallbackConfig) *FeatureStoreFallback

func (*FeatureStoreFallback) CompleteItemsIfNeed

func (r *FeatureStoreFallback) CompleteItemsIfNeed() bool

func (*FeatureStoreFallback) GetTimer

func (r *FeatureStoreFallback) GetTimer() *time.Timer

func (*FeatureStoreFallback) PutTimer added in v2.5.6

func (r *FeatureStoreFallback) PutTimer(t *time.Timer)

func (*FeatureStoreFallback) Recommend

func (r *FeatureStoreFallback) Recommend(context *context.RecommendContext) []*module.Item

type IFallback

type IFallback interface {
	GetTimer() *time.Timer
	PutTimer(*time.Timer)
	CompleteItemsIfNeed() bool
	Recommend(context *context.RecommendContext) []*module.Item
}

Jump to

Keyboard shortcuts

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