serializing

package
v0.0.0-...-63beb8f Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deserialize

func Deserialize[T any](inp []byte, obj T) error

Deserialize converts byte array to object

func Load

func Load(path string) ([]byte, error)

Load loads byte array from file

func LoadAndDeserialize

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

LoadAndDeserialize loads byte array from disk and deserializes it to the provided instantiated object

func Save

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

Save dumps data to disk

func Serialize

func Serialize[T any](obj T) ([]byte, error)

Serialize encodes input object as a byte array

func SerializeAndSave

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

SerializeAndSave serializes object, which should be a struct with at least one public field, to a byte array and dumps it to disk

Types

This section is empty.

Jump to

Keyboard shortcuts

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