API Reference
This section provides the complete API reference for the github.com/cybergodev/json library.
Module Index
| Module | Description |
|---|---|
| Package Functions | Package-level function reference, including path queries, type getters, encoding/decoding, etc. |
| Processor | Processor methods and configuration |
| Config | Configuration options in detail |
| Type Definitions | Core type definitions (including Encoder/Decoder) |
| Generic Operations | Generic API reference |
| Interface Definitions | Extension interface definitions |
| Stream Processing | Stream processor reference |
| NDJSON Processing | JSONL/NDJSON processor |
| Iterator | Iteration traversal API |
| Helper Functions | Type conversion and utility functions |
| Pretty Print | Formatting and pretty-print output |
| Security | Security-related API |
| Validator | Schema validator |
| Hook System | Operation interception hooks |
| Custom Encoder | Custom encoders |
| Constants & Errors | Constants and error types |
Quick Find
By Feature Category
Path Queries
| Function | Description |
|---|---|
Get, GetString, GetInt, GetFloat, GetBool, GetArray, GetObject | Type-safe getters |
GetTyped[T] | Generic getter |
SafeGet | Safe getter returning AccessResult |
GetMultiple | Batch getter |
Modify Operations
| Function | Description |
|---|---|
Set, SetMultiple | Set values |
SetCreate, SetMultipleCreate | Set values with automatic path creation |
Delete, DeleteClean | Delete values |
ProcessBatch | Batch operations |
Encoding & Decoding
| Function | Description |
|---|---|
Marshal, Unmarshal | Standard encoding/decoding |
MarshalIndent | Pretty-print encoding |
Encode, EncodeWithConfig | Encode to string |
NewEncoder, NewDecoder | Stream encoding/decoding |
Parse | Parse JSON |
Formatting
| Function | Description |
|---|---|
Prettify | Format JSON |
Compact | Compact JSON |
File Operations
| Function | Description |
|---|---|
LoadFromFile, SaveToFile | File read/write |
LoadFromReader | Read from Reader |
MarshalToFile, UnmarshalFromFile | File encoding/decoding |
Stream Processing
| Type/Method | Description |
|---|---|
ForeachFile | File stream processing |
NDJSONProcessor | NDJSON/JSONL processor |
JSONLWriter | JSONL writer |
Validation
| Function | Description |
|---|---|
Valid | JSON validation |
ValidateSchema | Schema validation (used with Schema type) |
Naming Conventions
The library follows these naming conventions:
| Pattern | Description | Example |
|---|---|---|
Get{Type} | Get specified type (supports defaultValue) | GetString, GetInt |
GetTyped[T] | Generic getter, returns T | GetTyped[User] |
New{Type} | Create instance | New (returns *Processor), NewEncoder |
Default{Type} | Default configuration | DefaultConfig |
{Type}Config | Configuration preset | SecurityConfig, PrettyConfig |
Related
- Getting Started -- Installation and basic usage
- Path Expression Syntax -- Path query syntax
- Usage Examples -- Practical code examples
- Large File Processing -- Stream processing guide