file

package
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package file provides functionality to load and save marshal files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSaveJSONWorker

func NewSaveJSONWorker(repeat time.Duration, path string, data interface{}) *worker.Worker

NewSaveJSONWorker Starts a worker, which save periodly data to json file

func ReadJSON

func ReadJSON(path string, data interface{}) error

ReadJSON reads a config model from path of a yml file

func ReadTOML

func ReadTOML(file string, data interface{}) error

ReadTOML reads a config model from path of a toml file

func SaveJSON

func SaveJSON(outputFile string, data interface{}) error

SaveJSON to path

func SaveTOML added in v1.2.0

func SaveTOML(outputFile string, data interface{}) error

SaveTOML to path

Types

type TOMLDuration added in v1.2.0

type TOMLDuration time.Duration

TOMLDuration a time.Duration inside toml files

func (TOMLDuration) MarshalText added in v1.2.0

func (d TOMLDuration) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler

func (*TOMLDuration) UnmarshalText added in v1.2.0

func (d *TOMLDuration) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL