octolab / config

🎛 Configuration toolkit.
https://go.octolab.org/toolkit/config
MIT License
0 stars 0 forks source link

feature: decode from string #3

Open kamilsk opened 2 years ago

kamilsk commented 2 years ago

Motivation: there is no way to operate features (enable/disable them externally).

Draft

header := "X-Features: feature-a=true, feature-b=false"

features.Unmarshal(header)

PoC

vals := req.Header.Get(header.Features)

features.Apply(header)
if features.FindByName().Enabled {
  // do something
}

Related to octolab/protocol/issues/10.

To do: