Skip to content

Commit

Permalink
docs: improve documentation and testing across the project
Browse files Browse the repository at this point in the history
- Update comments for `WithSkipper` function to provide detailed documentation on its parameters and return values

Signed-off-by: appleboy <[email protected]>
  • Loading branch information
appleboy committed Nov 8, 2024
1 parent e4203c4 commit ee07bd7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,17 @@ func WithServerErrorLevel(lvl zerolog.Level) Option {
})
}

// WithSkipper set function to skip middleware
// requests with this function returning true will not have their logs written
// Default is nil
// WithSkipper returns an Option that sets the Skipper function in the config.
// The Skipper function determines whether a request should be skipped for logging.
//
// Parameters:
//
// s (Skipper): A function that takes a gin.Context and returns a boolean indicating
// whether the request should be skipped.
//
// Returns:
//
// Option: An option that sets the Skipper function in the config.
func WithSkipper(s Skipper) Option {
return optionFunc(func(c *config) {
c.skip = s
Expand Down

0 comments on commit ee07bd7

Please sign in to comment.