1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-16 04:24:56 +02:00

internal/log/RotatingFileOptions.go: adding implementation for the functional option pattern.

This commit is contained in:
Henrik Hautakoski 2024-02-20 19:43:27 +01:00
parent cd54b770a5
commit bcdaa9cea4

View file

@ -0,0 +1,17 @@
package log
import "time"
type RotatingFileOption func(*RotatingFile)
func WithMaxSize(value int64) RotatingFileOption {
return func(f *RotatingFile) {
f.maxSize = value
}
}
func WithMaxAge(value time.Duration) RotatingFileOption {
return func(f *RotatingFile) {
f.maxAge = value
}
}