Documentation ¶
Index ¶
- func DecompressAndDeserialize(data []byte, result any) error
- func Load(ctx context.Context, r io.Reader, data any) error
- func LoadFromFS(ctx context.Context, fileSystem fs.FS, path string, data any) error
- func LoadFromFile(ctx context.Context, path string, data any) error
- func Save(ctx context.Context, w io.Writer, data any) error
- func SaveToFile(ctx context.Context, path string, data any) error
- func SerializeAndCompress(data any) ([]byte, error)
- type Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecompressAndDeserialize ¶
DecompressAndDeserialize decompresses the buffer, then loads JSON data from it.
func LoadFromFS ¶
LoadFromFS loads JSON data from the specified filesystem path.
func LoadFromFile ¶
LoadFromFile loads JSON data from the specified path.
func SaveToFile ¶
SaveToFile writes the data as JSON to the given path. Parent directories will be created automatically, if needed.
func SerializeAndCompress ¶
SerializeAndCompress writes the data as JSON into a buffer, then compresses it.
Types ¶
type Time ¶
Time is a time.Time that has been tailored to be used with JSON in this application.
func NewTimeFrom ¶ added in v5.3.0
NewTimeFrom returns a time & date from a string.
func (Time) Compare ¶ added in v5.19.0
Compare returns an integer comparing this time to the other time.
func (Time) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.