Skip to content

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

  1. Read CONTROL_PLANE_URL, POLL_INTERVAL, USER_KEY, optional FLAG_NAME from the environment.
  2. Loop: fetch flags (GET /flags or GET /flags/{name}), sort by name.
  3. For each flag call eval.Evaluate(flag, userKey).
  4. Print [state] on first sight and [CHANGE] old -> new when the effective value differs from the previous poll.
  5. 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)
  • openwiki/evaluation/flag-evaluation.md
  • openwiki/configuration/environment.md