jio

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2025 License: MIT Imports: 3 Imported by: 1

Documentation

Overview

Package jio provides convenience functions for saving and loading JSON-encoded values.

Uses the aio package for I/O.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Iter added in v0.5.0

func Iter[T any](file string) func(yield func(T, error) bool)

Iter returns an iterator over sequential JSON values in a file.

Note: a file with several independent JSON values is not a valid JSON file.

func Read added in v1.0.1

func Read(file string, v interface{}) error

Read loads a JSON encoded value from the given file and populates v with it.

func Write added in v1.0.1

func Write(file string, v interface{}) error

Write saves v to the given file, encoded as JSON.

Types

This section is empty.

Jump to

Keyboard shortcuts

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