Data Plane Client
Responsibility
examples/client/main.go is the reference data plane: it polls the control
plane, evaluates every flag in memory for one user key, and prints a CHANGE
line when a flag's effective value flips. It demonstrates the decoupling of
deploy from release.
Flow
- Read
CONTROL_PLANE_URL,POLL_INTERVAL,USER_KEY, optionalFLAG_NAMEfrom the environment. - Loop: fetch flags (
GET /flagsorGET /flags/{name}), sort by name. - For each flag call
eval.Evaluate(flag, userKey). - Print
[state]on first sight and[CHANGE] old -> newwhen the effective value differs from the previous poll. - Sleep
POLL_INTERVAL, repeat. Errors are logged and retried.
Evaluation
Evaluation runs locally in the client via internal/eval (kill switch, enabled,
deterministic rollout by user key). The server never evaluates; it only stores
and serves flag definitions. See openwiki/evaluation/flag-evaluation.md.
Configuration
CONTROL_PLANE_URL(default http://localhost:8080)POLL_INTERVAL(default 2s)USER_KEY(default demo-user)FLAG_NAME(optional filter)
Related
openwiki/evaluation/flag-evaluation.mdopenwiki/configuration/environment.md