types

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientStats

type ClientStats struct {
	*ServerStats
	// contains filtered or unexported fields
}

func NewClientStats

func NewClientStats() *ClientStats

func (*ClientStats) ExpectedResponseCount

func (c *ClientStats) ExpectedResponseCount() uint32

func (*ClientStats) Response

func (c *ClientStats) Response(expected bool)

func (*ClientStats) String

func (c *ClientStats) String() string

func (*ClientStats) UnexpectedResponseCount

func (c *ClientStats) UnexpectedResponseCount() uint32

type ClientStatsReadOnly

type ClientStatsReadOnly interface {
	ServerStatsReadOnly
	ExpectedResponseCount() uint32
	UnexpectedResponseCount() uint32
}

type MockClient

type MockClient interface {
	// SyncCall sends a sync request, if returns true means request receives expected response.
	SyncCall() bool
	// AsyncCall sends a request but not wait for responses.
	AsyncCall()
	// Stats returns client metrics. If AsyncCall is called, use metrics to check results.
	Stats() ClientStatsReadOnly
	// Close closes all client connections
	Close()
}

MockClient mocks a downstream client

type MockServer

type MockServer interface {
	// Start runs a mock server
	Start()
	// Close stops a mock server
	Stop()
	// Stats returns a ServerStats
	Stats() ServerStatsReadOnly
}

MockServer mocks a upstream server for mosn test

type Records

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

func NewRecords

func NewRecords() *Records

func (*Records) RecordRequest

func (r *Records) RecordRequest()

func (*Records) RecordResponse

func (r *Records) RecordResponse(statuscode int16)

records response info, notice not all request will send response

func (*Records) Requests

func (r *Records) Requests() uint32

func (*Records) ResponseInfo

func (r *Records) ResponseInfo() (map[int16]uint32, uint32)

func (*Records) String

func (r *Records) String() string

type ServerStats

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

func NewServerStats

func NewServerStats() *ServerStats

func (*ServerStats) ActiveConnection

func (s *ServerStats) ActiveConnection()

func (*ServerStats) CloseConnection

func (s *ServerStats) CloseConnection()

func (*ServerStats) ConnectionActive

func (s *ServerStats) ConnectionActive() uint32

func (*ServerStats) ConnectionClosed

func (s *ServerStats) ConnectionClosed() uint32

func (*ServerStats) ConnectionTotal

func (s *ServerStats) ConnectionTotal() uint32

func (*ServerStats) Records

func (s *ServerStats) Records() *Records

func (*ServerStats) Requests

func (s *ServerStats) Requests() uint32

func (*ServerStats) ResponseInfo

func (s *ServerStats) ResponseInfo() (map[int16]uint32, uint32)

func (*ServerStats) String

func (s *ServerStats) String() string

type ServerStatsReadOnly

type ServerStatsReadOnly interface {
	ConnectionTotal() uint32
	ConnectionActive() uint32
	ConnectionClosed() uint32
	Requests() uint32
	ResponseInfo() (map[int16]uint32, uint32)
	String() string
}

Jump to

Keyboard shortcuts

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