Documentation ¶
Index ¶
- type Batch
- type BatchOptions
- type Client
- type Factory
- type ParsedResponse
- type ParsedResponses
- func (r ParsedResponses) Check(check func(int, *ParsedResponse) error) (err error)
- func (r ParsedResponses) CheckHost(expected string) error
- func (r ParsedResponses) CheckHostOrFail(t testing.TB, expected string)
- func (r ParsedResponses) CheckOK() error
- func (r ParsedResponses) CheckOKOrFail(t testing.TB)
- func (r ParsedResponses) CheckOrFail(t testing.TB, check func(int, *ParsedResponse) error)
- func (r ParsedResponses) CheckPort(expected int) error
- func (r ParsedResponses) CheckPortOrFail(t testing.TB, expected int)
- func (r ParsedResponses) Count(text string) int
- func (r ParsedResponses) Len() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch struct {
// contains filtered or unexported fields
}
Batch processes a Batch of requests.
func NewBatch ¶
func NewBatch(ops BatchOptions) (*Batch, error)
NewBatch creates a new batch processor with the given options.
type BatchOptions ¶
type BatchOptions struct { Dialer application.Dialer Count int QPS int Timeout time.Duration URL string UDS string Header http.Header Message string CAFile string }
BatchOptions provides options to the batch processor.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a simple client for forwarding echo requests between echo applications.
func NewClient ¶
NewClient creates a new EchoClient instance that is connected to the given address.
func (*Client) ForwardEcho ¶
func (c *Client) ForwardEcho(request *proto.ForwardEchoRequest) (ParsedResponses, error)
ForwardEcho sends the given forward request and parses the response for easier processing. Only fails if the request fails.
type Factory ¶
type Factory struct { Ports model.PortList TLSCert string TLSCKey string Version string UDSServer string }
Factory is a factory for echo applications.
func (*Factory) NewApplication ¶
func (f *Factory) NewApplication(dialer application.Dialer) (application.Application, error)
NewApplication implements the application.Factory interface.
type ParsedResponse ¶
type ParsedResponse struct { // Body is the body of the response Body string // ID is a unique identifier of the resource in the response ID string // Version is the version of the resource in the response Version string // Port is the port of the resource in the response Port string // Code is the response code Code string // Host is the host called by the request Host string // Hostname is the host that responded to the request Hostname string }
ParsedResponse represents a response to a single echo request.
func (*ParsedResponse) Count ¶
func (r *ParsedResponse) Count(text string) int
Count occurrences of the given text within the body of this response.
func (*ParsedResponse) IsOK ¶
func (r *ParsedResponse) IsOK() bool
IsOK indicates whether or not the code indicates a successful request.
type ParsedResponses ¶
type ParsedResponses []*ParsedResponse
ParsedResponses is an ordered list of parsed response objects.
func (ParsedResponses) Check ¶
func (r ParsedResponses) Check(check func(int, *ParsedResponse) error) (err error)
func (ParsedResponses) CheckHost ¶
func (r ParsedResponses) CheckHost(expected string) error
func (ParsedResponses) CheckHostOrFail ¶
func (r ParsedResponses) CheckHostOrFail(t testing.TB, expected string)
func (ParsedResponses) CheckOK ¶
func (r ParsedResponses) CheckOK() error
func (ParsedResponses) CheckOKOrFail ¶
func (r ParsedResponses) CheckOKOrFail(t testing.TB)
func (ParsedResponses) CheckOrFail ¶
func (r ParsedResponses) CheckOrFail(t testing.TB, check func(int, *ParsedResponse) error)
func (ParsedResponses) CheckPort ¶
func (r ParsedResponses) CheckPort(expected int) error
func (ParsedResponses) CheckPortOrFail ¶
func (r ParsedResponses) CheckPortOrFail(t testing.TB, expected int)
func (ParsedResponses) Count ¶
func (r ParsedResponses) Count(text string) int
Count occurrences of the given text within the bodies of all responses.
func (ParsedResponses) Len ¶
func (r ParsedResponses) Len() int
Len returns the length of the parsed responses.