fake

package
v0.0.0-...-e99f885 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package fake provide fake objects. This package is used only for test purpose.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API7Cloud

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

API7Cloud is a fake API7 Cloud server side implementation.

func NewAPI7Cloud

func NewAPI7Cloud() (*API7Cloud, error)

NewAPI7Cloud creates a fake API7 Cloud server.

func (*API7Cloud) Addr

func (api7 *API7Cloud) Addr() string

Addr returns the API7 Cloud addr.

func (*API7Cloud) Close

func (api7 *API7Cloud) Close() error

Close closes the API7 Cloud.

func (*API7Cloud) Expect

func (api7 *API7Cloud) Expect(uri string, statusCode int, body []byte)

Expect defines an expected response (status code, response body) for an URI.

func (*API7Cloud) Serve

func (api7 *API7Cloud) Serve() error

Serve starts to accept HTTP requests.

func (*API7Cloud) ServeHTTP

func (api7 *API7Cloud) ServeHTTP(rw http.ResponseWriter, req *http.Request)

ServeHTTP implements the HTTP.Handler interface.

Jump to

Keyboard shortcuts

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