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
Click to show internal directories.
Click to hide internal directories.