Documentation ¶
Index ¶
- type Providerdeprecated
- func (p *Provider) BooleanEvaluation(ctx context.Context, flagKey string, defaultValue bool, ...) of.BoolResolutionDetail
- func (p *Provider) EventChannel() <-chan of.Event
- func (p *Provider) FloatEvaluation(ctx context.Context, flagKey string, defaultValue float64, ...) of.FloatResolutionDetail
- func (p *Provider) Hooks() []of.Hook
- func (p *Provider) Init(of.EvaluationContext)
- func (p *Provider) IntEvaluation(ctx context.Context, flagKey string, defaultValue int64, ...) of.IntResolutionDetail
- func (p *Provider) IsReady() <-chan struct{}
- func (p *Provider) Metadata() of.Metadata
- func (p *Provider) ObjectEvaluation(ctx context.Context, flagKey string, defaultValue interface{}, ...) of.InterfaceResolutionDetail
- func (p *Provider) Shutdown()
- func (p *Provider) Status() of.State
- func (p *Provider) StringEvaluation(ctx context.Context, flagKey string, defaultValue string, ...) of.StringResolutionDetail
- type ProviderConfiguration
- type ProviderOption
- func FromEnv() ProviderOption
- func WithContext(ctx context.Context) ProviderOption
- func WithLogger(l *logger.Logger) ProviderOption
- func WithSelector(selector string) ProviderOption
- func WithSourceType(providerType ProviderType) ProviderOption
- func WithSourceURI(uri string) ProviderOption
- func WithSyncStreamConnectionBackoff(duration time.Duration) ProviderOption
- func WithSyncStreamConnectionMaxAttempts(i int) ProviderOption
- func WithTLS(certPath string) ProviderOption
- type ProviderType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider
deprecated
type Provider struct {
// contains filtered or unexported fields
}
Deprecated: Please use flagd with WithInProcessResolver option instead of this dedicated provider
func NewProvider ¶
func NewProvider(ctx context.Context, opts ...ProviderOption) *Provider
Deprecated : Please use flagd with WithInProcessResolver option instead of this dedicated provider
func (*Provider) BooleanEvaluation ¶
func (p *Provider) BooleanEvaluation( ctx context.Context, flagKey string, defaultValue bool, evalCtx of.FlattenedContext, ) of.BoolResolutionDetail
func (*Provider) EventChannel ¶
func (*Provider) FloatEvaluation ¶
func (p *Provider) FloatEvaluation( ctx context.Context, flagKey string, defaultValue float64, evalCtx of.FlattenedContext, ) of.FloatResolutionDetail
func (*Provider) Hooks ¶
Hooks in-processflagd provider does not have any hooks, returns empty slice
func (*Provider) Init ¶
func (p *Provider) Init(of.EvaluationContext)
Init implements the Init method required for the OF API StateHandler interface
func (*Provider) IntEvaluation ¶
func (p *Provider) IntEvaluation( ctx context.Context, flagKey string, defaultValue int64, evalCtx of.FlattenedContext, ) of.IntResolutionDetail
func (*Provider) IsReady ¶
func (p *Provider) IsReady() <-chan struct{}
IsReady returns a non-blocking channel if the provider has completed the initial flag sync
func (*Provider) Metadata ¶
Metadata returns value of Metadata (name of current service, exposed to openfeature sdk)
func (*Provider) ObjectEvaluation ¶
func (p *Provider) ObjectEvaluation( ctx context.Context, flagKey string, defaultValue interface{}, evalCtx of.FlattenedContext, ) of.InterfaceResolutionDetail
func (*Provider) Shutdown ¶
func (p *Provider) Shutdown()
Shutdown implements the shutdown logic for this provider
func (*Provider) StringEvaluation ¶
func (p *Provider) StringEvaluation( ctx context.Context, flagKey string, defaultValue string, evalCtx of.FlattenedContext, ) of.StringResolutionDetail
type ProviderConfiguration ¶
type ProviderConfiguration struct { CertificatePath string TLSEnabled bool SourceConfig runtime.SourceConfig }
type ProviderOption ¶
type ProviderOption func(*Provider)
func FromEnv ¶
func FromEnv() ProviderOption
FromEnv sets the provider configuration from environment variables (if set) as defined https://github.com/open-feature/flagd/blob/main/docs/other_resources/creating_providers.md?plain=1#L117
func WithContext ¶
func WithContext(ctx context.Context) ProviderOption
WithContext supplies the given context to the event stream. Not to be confused with the context used in individual flag evaluation requests.
func WithLogger ¶
func WithLogger(l *logger.Logger) ProviderOption
WithLogger sets the logger used by the provider.
func WithSelector ¶
func WithSelector(selector string) ProviderOption
WithSelector sets the selector for the sync source
func WithSourceType ¶
func WithSourceType(providerType ProviderType) ProviderOption
func WithSourceURI ¶
func WithSourceURI(uri string) ProviderOption
WithSourceURI sets the URI of the sync source
func WithSyncStreamConnectionBackoff ¶
func WithSyncStreamConnectionBackoff(duration time.Duration) ProviderOption
WithSyncStreamConnectionBackoff sets the backoff duration between reattempts of connecting to the sync source.
func WithSyncStreamConnectionMaxAttempts ¶
func WithSyncStreamConnectionMaxAttempts(i int) ProviderOption
WithSyncStreamConnectionMaxAttempts sets the maximum number of attempts to connect to flagd's event stream. On successful connection the attempts are reset.
func WithTLS ¶
func WithTLS(certPath string) ProviderOption
WithTLS enables TLS. If certPath is not given, system certs are used.
type ProviderType ¶
type ProviderType string
const ( SourceTypeGrpc ProviderType = "grpc" SourceTypeKubernetes ProviderType = "kubernetes" )