OpenFeature.Provider.Flagd.HTTP (OpenFeature Flagd v0.1.0)

View Source

OpenFeature provider for flagd that communicates with a flagd instance over HTTP.

This is a remote flagd provider that uses the HTTP evaluation API (JSON) to resolve flag values.

Summary

Types

t()

HTTP provider for flagd

Functions

Creates a new flagd HTTP provider.

Types

t()

(since 0.1.0)
@type t() :: %OpenFeature.Provider.Flagd.HTTP{
  domain: String.t() | nil,
  hooks: [OpenFeature.Hook.t()],
  host: String.t(),
  name: String.t(),
  port: pos_integer(),
  req: Req.Request.t() | nil,
  req_opts: keyword(),
  scheme: String.t(),
  state: :not_ready | :ready
}

HTTP provider for flagd

Functions

new(opts \\ [])

(since 0.1.0)
@spec new(opts :: Keyword.t()) :: t()

Creates a new flagd HTTP provider.

Options

  • :scheme - The URL scheme (default: "http")
  • :host - The hostname or IP address of the flagd instance (default: "localhost")
  • :port - The port number (default: 8013)
  • :name - (optional) Custom name for the provider (default: "FlagdHTTP")
  • :domain - (optional) Domain name to differentiate between providers
  • :hooks - (optional) A list of OpenFeature hooks (%OpenFeature.Hook{})
  • :req_opts - (optional) Keyword list passed to Req.new/1

Examples

# Simple usage with defaults
provider = OpenFeature.Provider.Flagd.HTTP.new()

# With custom options
provider = OpenFeature.Provider.Flagd.HTTP.new(port: 8013, domain: "my-service")

# With HTTPS
provider = OpenFeature.Provider.Flagd.HTTP.new(scheme: "https", host: "flagd.example.com")