filestorage

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: AGPL-3.0 Imports: 3 Imported by: 13

Documentation

Overview

Utility to store objects persistently in json files.

Index

Constants

This section is empty.

Variables

View Source
var (
	LoadData  = Default_LoadData
	StoreData = Default_StoreData
)

Functions

func Default_LoadData added in v1.0.1

func Default_LoadData(path string, data *[]byte) error

reads raw data from filesystem, relative to BasePath

func Default_StoreData added in v1.0.1

func Default_StoreData(path string, data []byte) error

writes data to file, relative to BasePath

func LoadObject

func LoadObject[T any](path string, obj *T) error

reads and unmashalls json file from filesystem, relative to BasePath

func StoreObject

func StoreObject[T any](path string, obj T) error

serializes object as json and writes to file, relative to BasePath

Types

This section is empty.

Jump to

Keyboard shortcuts

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