Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomEndpoints ¶
func NewCustomEndpoints ¶
func NewCustomEndpoints(endpoints CustomResponseEndpoint) CustomEndpoints
type CustomResponseEndpoint ¶
type CustomResponseEndpoint map[string]struct { Method string Responses []CustomResponseEntry }
type CustomResponseEntry ¶
type CustomResponseEntry struct { RequestQueryFn RequestQueryFn `json:"-"` ResponseFn ResponseFn `json:"-"` }
type Endpoint ¶
type Endpoint map[string][]ResponseEntry
type ErrorResponse ¶
type ErrorResponse struct {
Message string `json:"message"`
}
type MockServer ¶
type MockServer interface { Stop() GetURL() string }
func NewMockServer ¶
func NewMockServer(properties ...MockServerProperty) (MockServer, error)
type MockServerError ¶
func NewMockServerError ¶
func NewMockServerError(statuscode int, format string, a ...interface{}) *MockServerError
func (MockServerError) Error ¶
func (m MockServerError) Error() string
type MockServerProperty ¶
type MockServerProperty func(*mockServer)
func WithCustomEndpoints ¶
func WithCustomEndpoints(endpoints CustomEndpoints) MockServerProperty
func WithFile ¶
func WithFile(file string) MockServerProperty
func WithFixedPort ¶
func WithFixedPort(port int) MockServerProperty
type RequestQuery ¶
type RequestQueryFn ¶
type ResponseEntry ¶
type ResponseEntry struct { RequestQuery *RequestQuery `json:"requestQuery" yaml:"requestQuery"` RequestQueryFn RequestQueryFn `json:"-" yaml:"-"` Response Response `json:"response" yaml:"response"` ResponseFn ResponseFn `json:"-" yaml:"-"` }
type ResponseFn ¶
type ResponseFn func(w http.ResponseWriter, r *http.Request) error
Click to show internal directories.
Click to hide internal directories.