Versions in this module Expand all Collapse all v1 v1.0.2 Aug 9, 2022 v1.0.1 Aug 9, 2022 Changes in this version + type Behaviors struct + Wait int + type Client struct + func NewClient(cli *http.Client, root *url.URL) *Client + func (cli *Client) AddStub(ctx context.Context, port, index int, stub Stub) (*Imposter, error) + func (cli *Client) Config(ctx context.Context) (*Config, error) + func (cli *Client) Create(ctx context.Context, imp Imposter) (*Imposter, error) + func (cli *Client) Delete(ctx context.Context, port int, replay bool) (*Imposter, error) + func (cli *Client) DeleteAll(ctx context.Context, replay bool) ([]Imposter, error) + func (cli *Client) DeleteRequests(ctx context.Context, port int) (*Imposter, error) + func (cli *Client) Imposter(ctx context.Context, port int, replay bool) (*Imposter, error) + func (cli *Client) Imposters(ctx context.Context, replay bool) ([]Imposter, error) + func (cli *Client) Logs(ctx context.Context, start, end int) ([]Log, error) + func (cli *Client) Overwrite(ctx context.Context, imps []Imposter) ([]Imposter, error) + func (cli *Client) OverwriteAllStubs(ctx context.Context, port int, stubs []Stub) (*Imposter, error) + func (cli *Client) OverwriteStub(ctx context.Context, port, index int, stub Stub) (*Imposter, error) + func (cli *Client) RemoveStub(ctx context.Context, port, index int) (*Imposter, error) + type Config struct + Options struct{ ... } + Process struct{ ... } + Version string + type HTTPRequest struct + Body interface{} + Headers http.Header + Method string + Path string + Query url.Values + RequestFrom net.IP + Timestamp string + func (r *HTTPRequest) UnmarshalJSON(b []byte) error + func (r HTTPRequest) MarshalJSON() ([]byte, error) + type HTTPResponse struct + Body interface{} + Headers http.Header + Mode string + StatusCode int + func (r *HTTPResponse) UnmarshalJSON(b []byte) error + func (r HTTPResponse) MarshalJSON() ([]byte, error) + type Imposter struct + AllowCORS bool + DefaultResponse interface{} + Name string + Port int + Proto string + RecordRequests bool + RequestCount int + Requests []interface{} + Stubs []Stub + func (imp *Imposter) UnmarshalJSON(b []byte) error + func (imp Imposter) MarshalJSON() ([]byte, error) + type JSONPath struct + Selector string + type Log struct + Level string + Message string + Timestamp time.Time + type Predicate struct + CaseSensitive bool + JSONPath *JSONPath + Operator string + Request interface{} + func (p *Predicate) UnmarshalJSON(b []byte) error + func (p Predicate) MarshalJSON() ([]byte, error) + type Response struct + Behaviors *Behaviors + Type string + Value interface{} + func (r *Response) UnmarshalJSON(b []byte) error + func (r Response) MarshalJSON() ([]byte, error) + type Stub struct + Predicates []Predicate + Responses []Response + func (s *Stub) UnmarshalJSON(b []byte) error + func (s Stub) MarshalJSON() ([]byte, error) + type TCPRequest struct + Data string + RequestFrom net.IP + func (r *TCPRequest) UnmarshalJSON(b []byte) error + func (r TCPRequest) MarshalJSON() ([]byte, error) + type TCPResponse struct + Data string + func (r *TCPResponse) UnmarshalJSON(b []byte) error + func (r TCPResponse) MarshalJSON() ([]byte, error)