Documentation
¶
Index ¶
- func AddToHistory(itm Item)
- func ClearHistory()
- func HistoryLength() int
- func LoadResponseHistory(dir string) error
- func LoadResponsesFrom(source io.ReadSeeker) error
- func Main(_ ...string)
- func SetHistDir(dir string)
- func StartServer(port string) error
- type Host
- type Item
- type Items
- type Request
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddToHistory ¶
func AddToHistory(itm Item)
AddToHistory inserts a pair request-response in the responseHistory.
func ClearHistory ¶
func ClearHistory()
func HistoryLength ¶
func HistoryLength() int
HistoryLength returns the number of entries in history
func LoadResponseHistory ¶
LoadResponseHistory loads all XML files found in `histDir` into the matcher's history. It does NOT clear the current history (use `ClearHistory()` for that). It does NOT recurse on the directory. In case of errors, it tries to load as much files as possible and reports the error afterwards.
func LoadResponsesFrom ¶
func LoadResponsesFrom(source io.ReadSeeker) error
LoadResponseFrom decodes an XML source and loads all req-resp pairs in the matcher's responseHistory.
func SetHistDir ¶
func SetHistDir(dir string)
SetHistDir changes the value of the history load directory. Calling `LoadResponseHistory` after this will load all the XML files found in the given directory.
func StartServer ¶
StartServer loads the response history from `histDir` and starts the Mocksy server on given `port`
Types ¶
type Host ¶
Host is used to deserialize burp saved XML. It contains text data and an attribute "ip".
type Item ¶
type Item struct {
Time string `xml:"time"`
Url string `xml:"url"`
Request Request `xml:"request"`
Host Host `xml:"host"`
Port string `xml:"port"`
Protocol string `xml:"protocol"`
Method string `xml:"method"`
Path string `xml:"path"`
Extension string `xml:"extension"`
Status string `xml:"status"`
ResponseLength string `xml:"responselength"`
Response Response `xml:"response"`
Mimetype string `xml:"mimetype"`
Comment string `xml:"comment"`
}
Item is used to deserialize burp saved XML. It is the element containing all the information about a single request.
type Items ¶
type Items struct {
Items []Item `xml:"item"`
}
Items is used to deserialize burp saved XML. It is the root element, containing a list of Item's.
type Request ¶
Response is struct used to deserialize burp XML. It contains text data and an attribute telling if the content is base64 or not.
type Response ¶
Response is struct used to deserialize burp XML. It contains text data and an attribute telling if the content is base64 or not.
func FindMatching ¶
FindMatching takes an http request and returns the closest match to it based on the response history.