Documentation
¶
Overview ¶
Package ffcontext exposes the evaluation context types and helpers of the public API.
Index ¶
Constants ¶
const ( ReservedKey = corectx.ReservedKey LegacyReservedKey = corectx.LegacyReservedKey )
ReservedKey is the evaluation context attribute holding the Semaphore specific fields. LegacyReservedKey is the name used by GO Feature Flag, still accepted.
Variables ¶
This section is empty.
Functions ¶
func HasReservedKey ¶
HasReservedKey tells if the attributes carry the reserved attribute, under any of its names.
Types ¶
type EvaluationContext ¶
type EvaluationContext = corectx.EvaluationContext
EvaluationContext is the evaluation context with the attributes used by the rules.
func NewAnonymousEvaluationContext
deprecated
func NewAnonymousEvaluationContext(key string) EvaluationContext
NewAnonymousEvaluationContext returns an anonymous evaluation context with the given key.
Deprecated: NewAnonymousEvaluationContext is here for compatibility reason. Please use NewEvaluationContext instead and add a attributes attribute to know that it is an anonymous user.
ctx := NewEvaluationContext("my-targetingKey") ctx.AddCustomAttribute("anonymous", true).
func NewEvaluationContext ¶
func NewEvaluationContext(key string) EvaluationContext
NewEvaluationContext creates a new evaluation context identified by the given targetingKey.
type EvaluationContextBuilder ¶
type EvaluationContextBuilder = corectx.EvaluationContextBuilder
EvaluationContextBuilder builds an EvaluationContext.
func NewEvaluationContextBuilder ¶
func NewEvaluationContextBuilder(key string) *EvaluationContextBuilder
NewEvaluationContextBuilder constructs a new EvaluationContextBuilder, specifying the user targetingKey.
For authenticated users, the targetingKey may be a username or e-mail address. For anonymous users, this could be an IP address or session ID.
type GoffContextSpecifics ¶
type GoffContextSpecifics = corectx.GoffContextSpecifics
GoffContextSpecifics holds the context fields specific to GO Feature Flag.