We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'd recommend the plan structs to be changed to the following:
type Rule struct { RuleSelector RuleSelector `json:"selector,omitempty"` RuleAction RuleAction `json:"action,omitempty"` } type RuleSelector struct { // SelectRule does prefix matching on this value ClientAddr string `json:"client_addr,omitempty"` Command string `json:"command,omitempty"` Percentage float64 `json:"percentage,omitempty"` } type RuleAction struct { Delay int `json:"delay,omitempty"` Drop bool `json:"drop,omitempty"` ReturnEmpty bool `json:"return_empty,omitempty"` }
Which would result in the following JSON:
{ "rules": [ { "selector": { "command": "GET", }, "action": { "delay": 1000 }, }, { "selector": { "clientAddr": "159.0.147.225", "percentage": 50, }, "action": { "drop": true }, }, { "selector": { "percentage": 50, }, "action": { "returnEmpty": true } } ] }
Adding support for YAML is recommended too.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'd recommend the plan structs to be changed to the following:
Which would result in the following JSON:
Adding support for YAML is recommended too.
The text was updated successfully, but these errors were encountered: