Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPClient ¶
HTTPClient interface for making http calls that can be mocked in tests.
type Request ¶
type Request struct {
Chains []SubrequestChain `json:"request"`
}
Request contains a collection of destination chains. It is the format of incoming requests.
type RequestHandler ¶
type RequestHandler struct {
// contains filtered or unexported fields
}
RequestHandler handles processing of incoming requests.
func (RequestHandler) ServeHTTP ¶
func (h RequestHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ResponseBody ¶
type ResponseBody struct {
Message string `json:"message"`
}
ResponseBody is a response body for returning a response to all requests made on api endpoints
type SimpleService ¶
type SimpleService struct {
// contains filtered or unexported fields
}
SimpleService can be used to mimic read services in test environments. It will listen for request on defined port, and send requests to envoyPort.
func NewSimpleService ¶
func NewSimpleService( hostname string, port int, envoyPort int, rabbitMQURL string, elasticsearchConfig elasticsearch.Config, pgsqlURL string, concurrency int, latency time.Duration, rejectRatio float64, cpuLoadPercentage int, ) *SimpleService
NewSimpleService creates a SimpleService instance.
func (SimpleService) Run ¶
func (ss SimpleService) Run() error
Run starts listening for requests on given port.
type Subrequest ¶
type Subrequest struct {
Destination string `json:"destination"`
}
Subrequest contains information on a single destination to which it should be routed.
type SubrequestChain ¶
type SubrequestChain struct {
// contains filtered or unexported fields
}
SubrequestChain is a single chain of destinations.
func (SubrequestChain) MarshalJSON ¶
func (sc SubrequestChain) MarshalJSON() ([]byte, error)
MarshalJSON writes the subrequest chain as a JSON list and not a JSON object.
func (*SubrequestChain) UnmarshalJSON ¶
func (sc *SubrequestChain) UnmarshalJSON(data []byte) error
UnmarshalJSON creates the subrequest chain, reading a JSON list and not a JSON object.