Documentation
¶
Index ¶
Constants ¶
View Source
const ProfileNotAvailableErr = "profile not available"
ProfileNotAvailableErr is a sentinel error message used to indicate that a profile is not yet available. This error is NOT cached, allowing retry when profile becomes available. After the cache layer, this error should be converted to a default value (e.g., false) to allow rule evaluation to continue without failing.
Variables ¶
This section is empty.
Functions ¶
func ConvertProfileNotAvailableErrToBool ¶ added in v0.3.9
ConvertProfileNotAvailableErrToBool converts a "profile not available" error to a boolean value. This should be called AFTER the cache layer to ensure the error is not cached, but the rule evaluation can continue with a default value.
func IsProfileNotAvailableErr ¶ added in v0.3.9
IsProfileNotAvailableErr checks if the given value is a "profile not available" error.
Types ¶
type FunctionCache ¶
type FunctionCache struct {
// contains filtered or unexported fields
}
func NewFunctionCache ¶
func NewFunctionCache(config FunctionCacheConfig) *FunctionCache
func (*FunctionCache) ClearCache ¶
func (fc *FunctionCache) ClearCache()
func (*FunctionCache) GetCacheStats ¶
func (fc *FunctionCache) GetCacheStats() (size int)
func (*FunctionCache) WithCache ¶
func (fc *FunctionCache) WithCache(fn CelFunction, functionName string) CelFunction
type FunctionCacheConfig ¶
type FunctionCacheConfig struct {
MaxSize int `mapstructure:"maxSize"`
TTL time.Duration `mapstructure:"ttl"`
}
func DefaultFunctionCacheConfig ¶
func DefaultFunctionCacheConfig() FunctionCacheConfig
Click to show internal directories.
Click to hide internal directories.