http

package
v0.13.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(iter *protocol.MockIterator, l logger.Logger) http.Handler

NewHandler returns a handler sending mock responses.

func Register added in v0.12.2

func Register()

Register registers http protocol.

Types

type HTTP

type HTTP struct{}

HTTP is a protocol type for the mock.

func (HTTP) Name

func (_ HTTP) Name() string

Name implements protocol.Protocol interface.

func (*HTTP) NewServer

func (_ *HTTP) NewServer(iter *protocol.MockIterator, l logger.Logger, config interface{}) (protocol.Server, error)

NewServer implements protocol.Protocol interface.

func (HTTP) UnmarshalConfig

func (_ HTTP) UnmarshalConfig(b []byte) (interface{}, error)

UnmarshalConfig implements protocol.Protocol interface.

type Response added in v0.12.2

type Response httpprotocol.Expect

Response represents an HTTP response.

func (*Response) Write added in v0.12.2

func (resp *Response) Write(w http.ResponseWriter) error

Write writes header and body.

type ServerConfig

type ServerConfig struct {
	Port int `yaml:"port,omitempty"`
}

ServerConfig represents a server configuration.

Jump to

Keyboard shortcuts

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