Documentation
¶
Index ¶
- type Bogus
- func (b *Bogus) AddPath(path string) *Path
- func (b *Bogus) Close()
- func (b *Bogus) HandlePaths(w http.ResponseWriter, r *http.Request)
- func (b *Bogus) HitRecords() []HitRecord
- func (b *Bogus) Hits() int
- func (b *Bogus) HostPort() (string, string)
- func (b *Bogus) SetPayload(p []byte)
- func (b *Bogus) SetStatus(s int)
- func (b *Bogus) Start()
- type HitRecord
- type Path
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bogus ¶
type Bogus struct {
// contains filtered or unexported fields
}
Bogus represents a test server
func (*Bogus) AddPath ¶
AddPath adds a new path to the bogus server handler and returns the new path for further configuration
func (*Bogus) Close ¶
func (b *Bogus) Close()
Close calls the close method for the underlying httptest server
func (*Bogus) HandlePaths ¶
func (b *Bogus) HandlePaths(w http.ResponseWriter, r *http.Request)
HandlePaths implements the http handler interface and decides how to respond based on the paths configured
func (*Bogus) HitRecords ¶
HitRecords returns a slice of the hit records recorded for inspection
func (*Bogus) SetPayload ¶
SetPayload is a convenience function allowing shorthand configuration of the payload for the default path
type HitRecord ¶
HitRecord represents a recording of information from a single hit againstr the bogus server
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
Path represents an endpoint added to a bogus server and how it should respond
func (*Path) SetMethods ¶
SetMethods accepts a list of methods the path should respond to
func (*Path) SetPayload ¶
SetPayload sets the response payload for the path and returns the path for additional configuration