Documentation
¶
Index ¶
- Variables
- func Clone(data map[string]interface{}) (map[string]interface{}, error)
- func DeleteValue(data map[string]interface{}, path string) bool
- func GetValue(data map[string]interface{}, path string) (interface{}, bool)
- func MergeJSON(base, overlay map[string]interface{}) map[string]interface{}
- func PrettyPrint(data map[string]interface{}) (string, error)
- func ReadJSON(path string) (map[string]interface{}, error)
- func SetValue(data map[string]interface{}, path string, value interface{}) error
- func Validate(path string) error
- func WriteJSON(path string, data map[string]interface{}, options ...JSONOptions) error
- type JSONFormat
- type JSONOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultJSONOptions = JSONOptions{ Format: FormatIndented, IndentPrefix: "", IndentSize: 2, }
DefaultJSONOptions provides default settings for JSON formatting
Functions ¶
func DeleteValue ¶
DeleteValue removes a value from JSON using a dot-notation path
func PrettyPrint ¶
PrettyPrint converts a map to a formatted JSON string
Types ¶
type JSONFormat ¶
type JSONFormat int
JSONFormat represents the formatting style for JSON files
const ( // FormatStandard uses standard JSON formatting FormatStandard JSONFormat = iota // FormatIndented uses indented JSON with 2-space indentation FormatIndented // FormatMinified removes all whitespace FormatMinified )
type JSONOptions ¶
type JSONOptions struct { Format JSONFormat IndentPrefix string IndentSize int }
JSONOptions provides configuration for JSON operations
Click to show internal directories.
Click to hide internal directories.