Skip to content

Instantly share code, notes, and snippets.

@JonCooperWorks
Created October 1, 2020 01:06
Show Gist options
  • Save JonCooperWorks/ad0c8fd4e22303cb8a864dc4724f58d1 to your computer and use it in GitHub Desktop.
Save JonCooperWorks/ad0c8fd4e22303cb8a864dc4724f58d1 to your computer and use it in GitHub Desktop.
// Listener must be implemented by a plugin to users to hook the request - response transaction.
// The Listen method will be run in its own goroutine, so plugins cannot block the rest of the program, however panics can take down the entire process.
type Listener interface {
Listen(results <-chan *Result)
}
// InitializerFunc is a go function that should be exported by a function package.
// It should be named "New".
// Your InitializerFunc should return an instance of your Listener with a reference to httpfuzz's logger for consistent logging.
type InitializerFunc func(*log.Logger) (Listener, error)
// Result is the request, response and associated metadata to be processed by plugins.
type Result struct {
Request *Request
Response *Response
Payload string
Location string
FieldName string
TimeElapsed time.Duration
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment