utils

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildHash

func BuildHash(flagName string, 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 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 added in v0.2.0

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