Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Configuration of the splitters Splitters []SplitterConfig // address to set up HTTP monitoring interface MonitorAddr string }
Config is the top level configuration description for a prism Server instance. Each Server has one monitor address (a debug and stats collection endpoint) and a set of Splitters.
Example ¶
package main import ( "fmt" "github.com/tmc/prism/config" ) func main() { c := config.Config{ Splitters: []config.SplitterConfig{ { Label: "main", ListenAddr: "localhost:7000", Source: "localhost:8000", Sinks: []config.Sink{ {"version a", "localhost:8001"}, {"version b", "localhost:8002"}, }, // Doesn't send requests to sinks until the response from // source arrives. WaitForResponse: true, }, }, MonitorAddr: ":7070", } fmt.Println(c) }
Output: {"Splitters":[{"Label":"main","ListenAddr":"localhost:7000","Source":"localhost:8000","WaitForResponse":true,"Sinks":[{"Name":"version a","Addr":"localhost:8001"},{"Name":"version b","Addr":"localhost:8002"}]}],"MonitorAddr":":7070"}
type SplitterConfig ¶
type SplitterConfig struct { Label string // arbitrary label for humans ListenAddr string // listen Addr Source string // upstream source http address WaitForResponse bool // if true, the requests are not relayed to sinks until the upstream response has been read. Sinks []Sink SinkRequestTimeout int `json:",omitempty"` // timeout on request to sinks in seconds RequestBufferSize int `json:",omitempty"` // size of request queue }
SplitterConfig describes an instance of a splitter.
Click to show internal directories.
Click to hide internal directories.