mocker

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Writer  http.ResponseWriter
	Request *http.Request
}

func (*Context) JSON

func (c *Context) JSON(code int, obj any)

func (*Context) JSONString

func (c *Context) JSONString(code int, str string)

func (*Context) Query

func (c *Context) Query(key string) (value string)

type H

type H map[string]any

type HandlerFunc

type HandlerFunc func(*Context)

type Server

type Server struct {
	URL string
	// contains filtered or unexported fields
}

func New

func New() *Server

func (*Server) Close

func (s *Server) Close()

func (*Server) GET

func (s *Server) GET(pattern string, handler HandlerFunc)

func (*Server) SetBasicAuth

func (s *Server) SetBasicAuth(username string, password string)

func (*Server) Start

func (s *Server) Start(port int) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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