Files
config/param/keys.go
andrey f9a0411192
All checks were successful
Go Action / goaction (push) Successful in 29s
def (#12)
Reviewed-on: #12
2025-12-26 14:55:42 +03:00

31 lines
468 B
Go

package param
type key int
const (
paramTimeFormat key = iota + 1
paramType
)
func WithTimeFormat(format string) Option {
return func(p Params) Params {
return With(p, paramTimeFormat, format)
}
}
func TimeFormat(fn Params) (string, bool) {
return String(fn, paramTimeFormat)
}
func WithType(in any) Option {
return func(v Params) Params {
return With(v, paramType, in)
}
}
func Type(fn Params) any {
param, _ := fn.Param(paramType)
return param
}