module OpenFeature
Defined in:
openfeature.cropenfeature/client.cr
openfeature/error.cr
openfeature/evaluation.cr
openfeature/event.cr
openfeature/hook.cr
openfeature/hooks/proc.cr
openfeature/provider.cr
openfeature/types.cr
Constant Summary
-
DEFAULT_PROVIDER_DOMAIN =
""
-
VERSION =
"0.3.0"
Class Method Summary
-
.add_handler(event : ProviderEvent, &handler : Handler)
add the handler to the global handler list
- .add_hook(&h : Hook)
-
.add_proc_hook(*, before : BeforeStageHook | Nil = nil, after : AfterStageHook | Nil = nil, error : ErrorStageHook | Nil = nil, finally : FinallyStageHook | Nil = nil)
Add proc based hook to global hooks
- .client(domain : Domain = DEFAULT_PROVIDER_DOMAIN, *, evaluation_context ectx : EvaluationContext | Nil = nil) : Client
- .global_context : EvaluationContext | Nil
- .global_context=(context ctx : EvaluationContext)
-
.handlers
the list of all globally registered handlers
- .hooks
- .provider(domain : Domain = DEFAULT_PROVIDER_DOMAIN) : Provider
- .provider=(provider : Provider)
-
.remove_handler(event : ProviderEvent, &handler : Handler)
remove the handler from the global handler list
- .set_provider(provider : Provider, domain : Domain = DEFAULT_PROVIDER_DOMAIN)
-
.transaction_context : EvaluationContext | Nil
retuerns the current transaction context or a new context without content
- .transaction_context=(ctx : EvaluationContext)
Class Method Detail
add the handler to the global handler list
def self.add_proc_hook(*, before : BeforeStageHook | Nil = nil, after : AfterStageHook | Nil = nil, error : ErrorStageHook | Nil = nil, finally : FinallyStageHook | Nil = nil)
#
Add proc based hook to global hooks
def self.client(domain : Domain = DEFAULT_PROVIDER_DOMAIN, *, evaluation_context ectx : EvaluationContext | Nil = nil) : Client
#
remove the handler from the global handler list
def self.transaction_context : EvaluationContext | Nil
#
retuerns the current transaction context or a new context without content