http

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: Apache-2.0 Imports: 15 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.

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 HTTPResponse

type HTTPResponse httpprotocol.Expect

HTTPResponse represents an HTTP response.

func (*HTTPResponse) Write

func (resp *HTTPResponse) 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