Documentation ¶
Overview ¶
Package client contains the quotes server client, configured with the provided config.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for the quotes server.
func (*Client) SendRequest ¶
SendRequest sends a request to the endpoint.
type Config ¶
type Config struct { // Logging is the logging configuration. Logging struct { // LogLevel is the log level to use. Level string `envconfig:"LOG_LEVEL" default:"debug"` // LogFormat is the log format to use. Format string `envconfig:"LOG_FORMAT" default:"console"` } // Connection is the connection configuration. Connection struct { // ServerHost is the host of server, that client will connect to ServerHost string `envconfig:"SERVER_HOST" default:"localhost"` // ServerPort is the port of server that the client will connect to ServerPort int `envconfig:"SERVER_PORT" default:"8080"` // RequestPath is the path of request that client will send to server RequestPath string `envconfig:"REQUEST_PATH" default:"/v1/quotes/random"` // RequestRatePerSecond defines how many requests per second client will send to server RequestRatePerSecond int `envconfig:"REQUEST_RATE_PER_SECOND" default:"100"` // RequestCount defines how many requests client will send to server. // If RequestCount is 0, client will send requests infinitely RequestCount int `envconfig:"REQUEST_COUNT" default:"0"` } }
Config is a configuration for client.
Click to show internal directories.
Click to hide internal directories.