-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
157 additions
and
157 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
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,35 @@ | ||
package mock | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/evg4b/uncors/internal/config" | ||
"github.com/evg4b/uncors/internal/contracts" | ||
"github.com/spf13/afero" | ||
) | ||
|
||
type HandlerOption = func(*Handler) | ||
|
||
func WithLogger(logger contracts.Logger) HandlerOption { | ||
return func(h *Handler) { | ||
h.logger = logger | ||
} | ||
} | ||
|
||
func WithResponse(response config.Response) HandlerOption { | ||
return func(h *Handler) { | ||
h.response = response | ||
} | ||
} | ||
|
||
func WithFileSystem(fs afero.Fs) HandlerOption { | ||
return func(h *Handler) { | ||
h.fs = fs | ||
} | ||
} | ||
|
||
func WithAfter(after func(duration time.Duration) <-chan time.Time) HandlerOption { | ||
return func(h *Handler) { | ||
h.after = after | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.