app

package
v0.0.0-...-fd2e718 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

type Counter struct {
	// contains filtered or unexported fields
}

func (*Counter) Decrement

func (c *Counter) Decrement()

func (*Counter) Increment

func (c *Counter) Increment()

func (*Counter) Value

func (c *Counter) Value() int

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL