readPolicy

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultReadPolicy

type DefaultReadPolicy[T config.TenantId, V any] struct {
	ConfigCacheOps cache.IConfigCacheRepo[T, V]
	ConfigDbRepo   db.IConfigDbRepo[T, V]
}

func NewDefaultReadPolicy

func NewDefaultReadPolicy[T config.TenantId, V any](configCacheOps cache.IConfigCacheRepo[T, V], configDbOps db.IConfigDbRepo[T, V]) *DefaultReadPolicy[T, V]

func (*DefaultReadPolicy[T, V]) GetConfig

func (r *DefaultReadPolicy[T, V]) GetConfig(ctx context.Context, key string, entityId T) (*V, error)

type IReadPolicy

type IReadPolicy[T config.TenantId, V any] interface {
	GetConfig(ctx context.Context, cacheKey string, entityId T) (*V, error)
}

type ReadPolicy

type ReadPolicy string
const (
	CacheAside ReadPolicy = "cache-aside"
)

func (ReadPolicy) Value

func (r ReadPolicy) Value() string

Jump to

Keyboard shortcuts

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