mocks

package
v0.0.0-...-e3620ad Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	HttpServer      *httptest.Server
	DefaultResponse *ServerResponseData
	Responses       map[string]*ServerResponseData
}

func NewTestServer

func NewTestServer() (server *Server)

func NewTlsTestServer

func NewTlsTestServer() (server *Server)

func (*Server) Close

func (s *Server) Close()

func (*Server) GetAddressAndPort

func (s *Server) GetAddressAndPort() (address string, port int, err error)

func (*Server) SetResponse

func (s *Server) SetResponse(status int, body string)

func (*Server) SetResponseForPath

func (s *Server) SetResponseForPath(path string, status int, body string)

func (*Server) SetResponseJson

func (s *Server) SetResponseJson(status int, v interface{})

func (*Server) SetResponseJsonForPath

func (s *Server) SetResponseJsonForPath(path string, status int, v interface{})

type ServerResponseData

type ServerResponseData struct {
	StatuCode *int
	Body      *string
}

Jump to

Keyboard shortcuts

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