json

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package json supports cs sources from json files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromPath added in v0.0.8

func FromPath(path, keyPrefix string, opts ...Option) cs.Source

FromPath creates a new source by parsing a json file at the given path

A non-empty keyPrefix will prepend the prefix to stored keys, in format [keyPrefix].[key]

func FromReader added in v0.0.8

func FromReader(r io.Reader, keyPrefix string, opts ...Option) cs.Source

FromReader reads from the reader into a byte array

Types

type Option added in v0.4.0

type Option func(*options)

Option configures a json source.

func ExpandEnv added in v0.4.0

func ExpandEnv() Option

ExpandEnv enables ${VAR} and $VAR expansion on string leaves of the decoded json tree using os.ExpandEnv semantics (unset variables expand to an empty string). Expansion is applied recursively to values inside objects and arrays.

Jump to

Keyboard shortcuts

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