resources

package
v0.11.10 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadFilesFromFs

func ReadFilesFromFs(sys fs.FS) (out map[string][]byte, err error)

ReadFilesFromFs reads every file from a file system into a memory map.

func ReadGobFromPath

func ReadGobFromPath[T any](path string) (out T, err error)

ReadGobFromPath reads data from a Gob file into a struct.

func ReadJsonFromPath added in v0.11.9

func ReadJsonFromPath[T any](path string) (out T, err error)

ReadJsonFromPath reads data from a JSON file into a struct.

func WriteFilesFromMap

func WriteFilesFromMap(in map[string][]byte, prefix string) (err error)

WriteFilesFromMap writes every file from the map to the file system.

func WriteGobToPath

func WriteGobToPath[T any](in T, path string) (err error)

WriteGobToPath encodes data as Gob and saves it to the filesystem by path.

func WriteJsonToPath added in v0.11.9

func WriteJsonToPath[T any](in T, path string) (err error)

WriteJsonToPath encodes data as JSON and saves it to the filesystem by path.

func WriteTempFilesFromMap

func WriteTempFilesFromMap(in map[string][]byte) (prefix string, err error)

WriteTempFilesFromMap writes every file from the map to the temporary file system.

Types

This section is empty.

Jump to

Keyboard shortcuts

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