mock

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RGroup

type RGroup struct {
	Request  *Request
	Response *Response
}

func (*RGroup) RBody

func (rg *RGroup) RBody(body io.Reader) *RGroup

func (*RGroup) RBodyString

func (rg *RGroup) RBodyString(body string) *RGroup

func (*RGroup) RFile

func (rg *RGroup) RFile(path string) *RGroup

func (*RGroup) RJSON

func (rg *RGroup) RJSON(data interface{}) *RGroup

func (*RGroup) RQuery

func (rg *RGroup) RQuery(query string) *RGroup

func (*RGroup) Reply

func (rg *RGroup) Reply(status int) *RGroup

func (*RGroup) WBody

func (rg *RGroup) WBody(body io.Reader) *RGroup

func (*RGroup) WBodyString

func (rg *RGroup) WBodyString(body string) *RGroup

func (*RGroup) WFile

func (rg *RGroup) WFile(path string) *RGroup

func (*RGroup) WJSON

func (rg *RGroup) WJSON(data interface{}) *RGroup

type Request

type Request struct {
	Query      string
	BodyBuffer []byte
	Error      error
}

type Response

type Response struct {
	StatusCode int
	BodyBuffer []byte
	Error      error
}

type RouterMap

type RouterMap struct {
	Path    string
	Method  string
	RGroups []*RGroup
}

func (*RouterMap) Handler

func (rm *RouterMap) Handler(w http.ResponseWriter, r *http.Request)

func (*RouterMap) RGroup

func (rm *RouterMap) RGroup() *RGroup

type Server

type Server struct {
	Addr   string
	Port   string
	Scheme string
	// contains filtered or unexported fields
}

func NewServer

func NewServer() *Server

func (*Server) AddRouter

func (s *Server) AddRouter(path string, method string) *RouterMap

func (*Server) Close

func (s *Server) Close()

func (*Server) Register

func (s *Server) Register()

Jump to

Keyboard shortcuts

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