Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions contract/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ var HooksKey = hooksKey{}
// AfterResponseHook is a callback invoked after the full HTTP response
// has been written. It receives the error returned by the handler,
// which may be nil if the handler succeeded.
type AfterResponseHook func(err error)
type AfterResponseHook = func(err error)

// BeforeWriteHeaderHook is a callback invoked just before the
// response status code is written. It receives the response writer
// and the status code that is about to be sent.
type BeforeWriteHeaderHook func(w http.ResponseWriter, status int)
type BeforeWriteHeaderHook = func(w http.ResponseWriter, status int)

// BeforeWriteHook is a callback invoked just before response body
// bytes are written. It receives the response writer and the byte
// slice that is about to be sent.
type BeforeWriteHook func(w http.ResponseWriter, content []byte)
type BeforeWriteHook = func(w http.ResponseWriter, content []byte)

// Hooks defines the contract for registering and retrieving
// lifecycle callbacks during HTTP request processing. Middleware
Expand Down
Loading