module OpenFeature

Defined in:

openfeature.cr
openfeature/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

Class Method Detail

def self.add_handler(event : ProviderEvent, &handler : Handler) #

add the handler to the global handler list


[View source]
def self.add_hook(&h : Hook) #

[View source]
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


[View source]
def self.client(domain : Domain = DEFAULT_PROVIDER_DOMAIN, *, evaluation_context ectx : EvaluationContext | Nil = nil) : Client #

[View source]
def self.global_context : EvaluationContext | Nil #

[View source]
def self.global_context=(context ctx : EvaluationContext) #

[View source]
def self.handlers #

the list of all globally registered handlers


[View source]
def self.hooks #

[View source]
def self.provider(domain : Domain = DEFAULT_PROVIDER_DOMAIN) : Provider #

[View source]
def self.provider=(provider : Provider) #

[View source]
def self.remove_handler(event : ProviderEvent, &handler : Handler) #

remove the handler from the global handler list


[View source]
def self.set_provider(provider : Provider, domain : Domain = DEFAULT_PROVIDER_DOMAIN) #

[View source]
def self.transaction_context : EvaluationContext | Nil #

retuerns the current transaction context or a new context without content


[View source]
def self.transaction_context=(ctx : EvaluationContext) #

[View source]