-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Ömer Faruk Irmak <[email protected]>
- Loading branch information
1 parent
9154861
commit 29b59bb
Showing
5 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package feeder | ||
|
||
import "time" | ||
|
||
type EventListener interface { | ||
OnResponse(urlPath string, status int, took time.Duration) | ||
} | ||
|
||
type SelectiveListener struct { | ||
OnResponseCb func(urlPath string, status int, took time.Duration) | ||
} | ||
|
||
func (l *SelectiveListener) OnResponse(urlPath string, status int, took time.Duration) { | ||
if l.OnResponseCb != nil { | ||
l.OnResponseCb(urlPath, status, took) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters