Documentation
¶
Index ¶
- Variables
- func DurationWithDefaultMinMax(s *string, defaultD, minD, maxD time.Duration) (time.Duration, error)
- func ParseDuration(s string) (time.Duration, error)
- func ReadFile(fs embed.FS, s string) string
- func Register(c Converter)
- type Converter
- type TBool
- type TDuration
- type TFileMode
- type TFloat64
- type TGroup
- type TInt
- type TInt64
- type TList
- type TListLowercase
- type TSet
- type TShlex
- type TSize
- type TString
- type TTristate
- type TUmask
- type TUser
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DB map[string]Converter
)
Functions ¶
func DurationWithDefaultMinMax ¶
func DurationWithDefaultMinMax(s *string, defaultD, minD, maxD time.Duration) (time.Duration, error)
DurationWithDefaultMinMax parses a duration string and clamps the result within minD and maxD or returns defaultD. If s is nil or empty, defaultD is returned, clamped within the range defined by minD and maxD.
func ParseDuration ¶
ParseDuration parses a duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
Types ¶
type TDuration ¶
type TDuration struct{}
type TListLowercase ¶
type TListLowercase struct{}
func (TListLowercase) String ¶
func (t TListLowercase) String() string
Click to show internal directories.
Click to hide internal directories.