utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildHash

func BuildHash(flagName, bucketingKey string, maxPercentage uint32) uint32

BuildHash is building the hash based on the different properties of the evaluation.

func Contains

func Contains(s []string, str string) bool

func ContextToMap

func ContextToMap(ctx ffcontext.Context) map[string]any

ContextToMap convert the context to a MAP to use the query on it.

func ContextToMapInto

func ContextToMapInto(dst map[string]any, ctx ffcontext.Context) map[string]any

ContextToMapInto is ContextToMap filling (and returning) the empty map dst, that the caller can reuse to avoid allocating a map for every evaluation.

func ConvertEvaluationCtxFromRequest

func ConvertEvaluationCtxFromRequest(
	targetingKey string,
	custom map[string]any,
) ffcontext.Context

ConvertEvaluationCtxFromRequest convert the result of an unmarshal request from the API to a ffcontext.Context @param targetingKey the targeting key to use for the context @param custom the custom attributes to add to the context @return ffcontext.Context

func GetNestedFieldValue

func GetNestedFieldValue(ctx map[string]any, bucketingKey string) (any, error)

GetNestedFieldValue returns the value from a nested path in the given map. If the path does not exist or an error occurs, it returns an error.

func Hash

func Hash(s string) uint32

Hash is taking a string and convert.

func IsIntegral

func IsIntegral(val float64) bool

IsIntegral returns true if the float is an integer.

func IsJSONObject

func IsJSONObject(s string) bool

IsJSONObject checks if a string is a valid JSON.

func JSONTypeExtractor

func JSONTypeExtractor(variation any) (string, error)

func StrTrim

func StrTrim(s string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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