Open source implementation of Livesport TV utilities library.
Packages provide Formatter and Parser variables to override default behavior of
format methods (MarshalText, MarshalJSON, String, ...)
and parse methods (UnmarshalText, UnmarshalJSON, ...).
Default value of Formatter is DefaultFormatter and default value of Parser is DefaultParser.
Also, specific verbs for fmt formatting are available.
import "go.lstv.dev/util/date"- Type
Daterepresents date (year, month, day). - Function
Newto create new date. - Function
DateFromTimeto create date fromtime.Time. - Type
DateFilterto work with date intervals and filtering.
import "go.lstv.dev/util/roman"- Type
Numberrepresents roman number. - It supports roman numerals:
M(1000)D(500)C(100)L(50)X(10)V(5)I(1)
- Short and long forms are also supported and configurable.
import "go.lstv.dev/util/sem"- Type
Versionrepresents semantic version. - Functions:
Compare,CompareVersionandCompareTagLatest,LatestVersionandLatestTagParse,ParseVersionandParseTag
- See Semantic Versioning 2.0.0 for more details.
import "go.lstv.dev/util/size"- Provides type
Sizeto keep, marshal and unmarshal times-byte size values. - It supports three JSON forms:
- numeric form (JSON number is always in bytes)
- string form (JSON string with or without units)
- object form (JSON object like
{"value":1000,"unit":"MiB"})
import "go.lstv.dev/util/test"- Provides functions to test marshal and unmarshal methods:
MarshalBinaryandUnmarshalBinaryMarshalTextandUnmarshalTextMarshalJSONandUnmarshalJSON
- See examples.
import "go.lstv.dev/util/uu"- Provides type
IDto keep, marshal and unmarshal UUID values.