Skip to content

API Reference

This section provides the complete API reference for the github.com/cybergodev/json library.

Module Index

ModuleDescription
Package FunctionsPackage-level function reference, including path queries, type getters, encoding/decoding, etc.
ProcessorProcessor methods and configuration
ConfigConfiguration options in detail
Type DefinitionsCore type definitions (including Encoder/Decoder)
Generic OperationsGeneric API reference
Interface DefinitionsExtension interface definitions
Stream ProcessingStream processor reference
NDJSON ProcessingJSONL/NDJSON processor
IteratorIteration traversal API
Helper FunctionsType conversion and utility functions
Pretty PrintFormatting and pretty-print output
SecuritySecurity-related API
ValidatorSchema validator
Hook SystemOperation interception hooks
Custom EncoderCustom encoders
Constants & ErrorsConstants and error types

Quick Find

By Feature Category

Path Queries

FunctionDescription
Get, GetString, GetInt, GetFloat, GetBool, GetArray, GetObjectType-safe getters
GetTyped[T]Generic getter
SafeGetSafe getter returning AccessResult
GetMultipleBatch getter

Modify Operations

FunctionDescription
Set, SetMultipleSet values
SetCreate, SetMultipleCreateSet values with automatic path creation
Delete, DeleteCleanDelete values
ProcessBatchBatch operations

Encoding & Decoding

FunctionDescription
Marshal, UnmarshalStandard encoding/decoding
MarshalIndentPretty-print encoding
Encode, EncodeWithConfigEncode to string
NewEncoder, NewDecoderStream encoding/decoding
ParseParse JSON

Formatting

FunctionDescription
PrettifyFormat JSON
CompactCompact JSON

File Operations

FunctionDescription
LoadFromFile, SaveToFileFile read/write
LoadFromReaderRead from Reader
MarshalToFile, UnmarshalFromFileFile encoding/decoding

Stream Processing

Type/MethodDescription
ForeachFileFile stream processing
NDJSONProcessorNDJSON/JSONL processor
JSONLWriterJSONL writer

Validation

FunctionDescription
ValidJSON validation
ValidateSchemaSchema validation (used with Schema type)

Naming Conventions

The library follows these naming conventions:

PatternDescriptionExample
Get{Type}Get specified type (supports defaultValue)GetString, GetInt
GetTyped[T]Generic getter, returns TGetTyped[User]
New{Type}Create instanceNew (returns *Processor), NewEncoder
Default{Type}Default configurationDefaultConfig
{Type}ConfigConfiguration presetSecurityConfig, PrettyConfig