capture/capture.go

22 lines
419 B
Go
Raw Normal View History

2017-11-21 22:36:40 +01:00
package main
type Capture struct {
Url string `json:"url"`
Method string `json:"method"`
Status int `json:"status"`
Request string `json:"request"`
Response string `json:"response"`
}
type Captures struct {
items []Capture
max int
}
func (c *Captures) Add(capture Capture) {
c.items = append([]Capture{capture}, c.items...)
if len(c.items) > c.max {
c.items = c.items[:len(c.items)-1]
}
}