Documentation
¶
Index ¶
- func AddConverter(n string, c Converter) error
- type ContextValue
- type Converter
- type Evaluator
- type Flagr
- func (Flagr) CaddyModule() caddy.ModuleInfo
- func (f *Flagr) Cleanup() error
- func (f *Flagr) Provision(ctx caddy.Context) (err error)
- func (f *Flagr) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
- func (f *Flagr) UnmarshalCaddyfile(d *caddyfile.Dispenser) (err error)
- func (f *Flagr) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddConverter ¶
Types ¶
type ContextValue ¶
type Converter ¶
func GetConverter ¶
type Evaluator ¶
type Evaluator interface {
PostEvaluationBatch(ctx context.Context, req *models.EvaluationBatchRequest) (*models.EvaluationBatchResponse, error)
}
type Flagr ¶
type Flagr struct {
// The address of the flagr server.
URL string `json:"url,omitempty"`
// Which evaluator to use.
// Supported options: "local" or "remote".
Evaluator string `json:"evaluator,omitempty"`
// The refresh interval of the internal eval cache (only used for the "local" evaluator).
RefreshInterval string `json:"refresh_interval,omitempty"`
// The unique ID from the entity, which is used to deterministically at
// random to evaluate the flag result. Must be a Caddy variable.
EntityID string `json:"entity_id,omitempty"`
// The context parameters (key-value pairs) from the entity, which is used
// to match the constraints.
EntityContext map[string]interface{} `json:"entity_context,omitempty"`
// A list of flag keys to look up.
FlagKeys []string `json:"flag_keys,omitempty"`
// Which element of the request to bind the evaluated variant keys.
// Supported options: "header.NAME" or "query.NAME".
BindVariantKeysTo string `json:"bind_variant_keys_to,omitempty"`
// contains filtered or unexported fields
}
Flagr implements a handler for applying Feature Flags for HTTP requests by using checkr/flagr.
func (Flagr) CaddyModule ¶
func (Flagr) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (*Flagr) UnmarshalCaddyfile ¶
UnmarshalCaddyfile implements caddyfile.Unmarshaler. Syntax:
flagr <url> {
evaluator <evaluator> [<refresh_interval>]
entity_id <entity_id>
entity_context {
<key1> <value1>
<key2> <value2>
...
}
flag_keys <key1> <key2> ...
bind_variant_keys_to <bind_variant_keys_to>
}
Click to show internal directories.
Click to hide internal directories.

