abstract class OpenFeature::Provider

Overview

The provider API defines interfaces that Provider Authors can use to abstract a particular flag management system, thus enabling the use of the evaluation API by Application Authors.

Providers are the "translator" between the flag evaluation calls made in application code, and the flag management system that stores flags and in some cases evaluates flags. At a minimum, providers should implement some basic evaluation methods which return flag values of the expected type. In addition, providers may transform the evaluation context appropriately in order to be used in dynamic evaluation of their associated flag management system, provide insight into why evaluation proceeded the way it did, and expose configuration options for their associated flag management system. Hypothetical provider implementations might wrap a vendor SDK, embed an REST client, or read flags from a local file.

Direct Known Subclasses

Defined in:

openfeature/provider.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(name : String, *, evaluation_context ectx : EvaluationContext | Nil = nil, metadata md : Metadata | Nil = nil, hooks : Hash(String, Array(OpenFeature::Hook)) = Hash(String, Array(Hook)).new) #

[View source]

Instance Method Detail

def add_client(client : Client) #

adds the passed client to the list of clients


[View source]
def evaluation_context : EvaluationContext #

[View source]
def metadata : Metadata #

[View source]
def name : String #

[View source]
def remove_client(client : Client) #

remove the clinet from the provider


[View source]
abstract def resolve_boolean_value(flag_key : FlagKey, default : Bool = true, ctx : EvaluationContext | Nil = nil) : ResolutionDetails #

[View source]
abstract def resolve_number_value(flag_key : FlagKey, default : Number = 0, ctx : EvaluationContext | Nil = nil) : ResolutionDetails #

[View source]
abstract def resolve_object_value(flag_key : FlagKey, default : Structure, ctx : EvaluationContext | Nil = nil) : ResolutionDetails #

[View source]
abstract def resolve_string_value(flag_key : FlagKey, default : String = "", ctx : EvaluationContext | Nil = nil) : ResolutionDetails #

[View source]
def state : ProviderEvent #

[View source]