jconf

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2025 License: MIT Imports: 8 Imported by: 0

README

jconf - simple Go package to read/write JSON/YAML config file

Functions

  • Write() - write JSON/YAML config file
  • Read() - read JSON/YAML config file
  • Show() - show structure to stdout as JSON
  • ShowYAML() - show structure to stdout as YAML

Documentation

Overview

jconf - simple Go package to read/write JSON config file

Functions:

Read() - read JSON config file

Write() - write JSON config file

Show() - show JSON config structure to stdout

Index

Constants

View Source
const FILE_MODE = 0640

Default config file mode

Variables

View Source
var YAML_EXTS = []string{
	".yaml", ".YAML",
	".yml", ".YML",
	".yconf", ".YCONF",
	".yml.conf", ".YML.CONF",
}

YAML config file extensions (suffixes)

Functions

func IsYAML added in v0.1.1

func IsYAML(fileName string) bool

Check file name is YAML

func Read

func Read(conf any, fileName string) error

Read JSON config file

func Show

func Show(conf any) error

Show structure to stdout as JSON

func ShowYAML added in v0.1.1

func ShowYAML(conf any) error

Show structure to stdout as YAML

func ToYAML added in v0.1.2

func ToYAML(conf any) (string, error)

Marshal YAML

func Write

func Write(conf any, fileName string) error

Write JSON/YAML config file

Types

This section is empty.

Jump to

Keyboard shortcuts

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