Documentation
¶
Overview ¶
Package fakesctl is the test-side client of the fakes' control API: it scripts a fake upstream's replies and reads back what the upstream received. It carries no build tag so any test package can import it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Requests ¶
func Requests(t testing.TB, base, upstream string) []control.RecordedRequest
Requests returns GET /_control/upstreams/{upstream}/requests: every request the upstream received since the last reset, in arrival order.
func Script ¶
Script sets the script of one (upstream, route) — or (upstream, route, key) when Key is passed — through PUT /_control/upstreams/{upstream}/routes/{route}. base is the fakes' root URL, such as http://127.0.0.1:9090.
Types ¶
type ScriptOption ¶ added in v0.12.0
type ScriptOption func(*scriptConfig)
ScriptOption configures a Script call.
func Key ¶ added in v0.12.0
func Key(bearer string) ScriptOption
Key restricts a scripted reply to requests bearing Authorization: Bearer <token>.