Documentation ¶
Overview ¶
Package jsp (JSON persistence) provides utilities to store and load arbitrary JSON-encoded structures with optional checksumming and compression.
- Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.
Package jsp (JSON persistence) provides utilities to store and load arbitrary JSON-encoded structures with optional checksumming and compression.
- Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
Package jsp (JSON persistence) provides utilities to store and load arbitrary JSON-encoded structures with optional checksumming and compression.
- Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
Package jsp (JSON persistence) provides utilities to store and load arbitrary JSON-encoded structures with optional checksumming and compression.
- Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
Package jsp (JSON persistence) provides utilities to store and load arbitrary JSON-encoded structures with optional checksumming and compression.
- Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
Index ¶
- Constants
- func Decode(reader io.ReadCloser, v any, opts Options, tag string) (checksum *cos.Cksum, err error)
- func Encode(ws cos.WriterAt, v any, opts Options) (err error)
- func Load(filepath string, v any, opts Options) (checksum *cos.Cksum, err error)
- func LoadAppConfig(configDir, configFname string, v any) (err error)
- func LoadMeta(filepath string, meta Opts) (*cos.Cksum, error)
- func Save(filepath string, v any, opts Options, wto io.WriterTo) (err error)
- func SaveAppConfig(configDir, configFname string, v any) error
- func SaveMeta(filepath string, meta Opts, wto io.WriterTo) error
- type ErrBadSignature
- type ErrJspCompatibleVersion
- type ErrUnsupportedMetaVersion
- type ErrVersion
- type Options
- type Opts
Constants ¶
const (
Metaver = 3
)
current JSP version
Variables ¶
This section is empty.
Functions ¶
func LoadAppConfig ¶
func SaveAppConfig ¶
Types ¶
type ErrBadSignature ¶
type ErrBadSignature struct {
// contains filtered or unexported fields
}
func (*ErrBadSignature) Error ¶
func (e *ErrBadSignature) Error() string
type ErrJspCompatibleVersion ¶
type ErrJspCompatibleVersion struct {
ErrVersion
}
func (*ErrJspCompatibleVersion) Error ¶
func (e *ErrJspCompatibleVersion) Error() string
type ErrUnsupportedMetaVersion ¶
type ErrUnsupportedMetaVersion struct {
ErrVersion
}
func (*ErrUnsupportedMetaVersion) Error ¶
func (e *ErrUnsupportedMetaVersion) Error() string
type ErrVersion ¶
type ErrVersion struct {
// contains filtered or unexported fields
}
func (*ErrVersion) Version ¶
func (e *ErrVersion) Version() uint32
type Options ¶
type Options struct { // when non-zero, formatting version of the structure that's being (de)serialized // (not to confuse with the jsp encoding version - see above) Metaver uint32 Compress bool // lz4 when [version == 1 || version == 2] Checksum bool // xxhash when [version == 1 || version == 2] Signature bool // when true, write 128bit prefix (of the layout shown above) at offset zero Indent bool // Determines if the JSON should be indented. Useful for CLI config. }