mock

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package mock provides mock handlers for testing.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Called int
}

Handler used when mocking out middleware tests.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(http.ResponseWriter, *http.Request)

ServeHTTP just increments the call count.

Example
package main

import (
	"fmt"

	"bitbucket.org/idomdavis/gosecure/mock"
)

func main() {
	h := &mock.Handler{}

	h.ServeHTTP(nil, nil)
	fmt.Println(h.Called)

}
Output:

1

Jump to

Keyboard shortcuts

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