Versions in this module Expand all Collapse all v1 v1.0.0 Apr 16, 2025 Changes in this version + func BuildJSONPointer(segments ...interface{}) (string, error) + func ClearArray(v *Value) + func ClearObject(v *Value) + func Copy(dst, src *Value) + func CopySafe(dst, src *Value) error + func CopySafeWithReplacement(dst, src *Value) + func CustomCopySafeWithReplacement(dst, src *Value, replacer CircularReplacer) + func Equal(lhs, rhs *Value) bool + func EraseArrayElement(v *Value, index, count int) + func FindObjectIndex(v *Value, key string) int + func Free(v *Value) + func GetArrayCapacity(v *Value) int + func GetArraySize(v *Value) int + func GetBoolean(v *Value) bool + func GetErrorMessage(code ParseError) string + func GetNumber(v *Value) float64 + func GetObjectCapacity(v *Value) int + func GetObjectKey(v *Value, index int) string + func GetObjectSize(v *Value) int + func GetString(v *Value) string + func HasCycle(v *Value) bool + func Move(dst, src *Value) + func ParseJSONPointer(pointer string) (*JSONPointer, JSONPointerError) + func PopBackArrayElement(v *Value) + func RemoveObjectValue(v *Value, index int) + func RemoveValueByPointer(v *Value, pointerStr string) error + func ReserveArray(v *Value, capacity int) + func ReserveObject(v *Value, capacity int) + func SafeCopyWithReplacer(dst, src *Value, replacer CircularReplacer) + func SetArray(v *Value, capacity int) + func SetBoolean(v *Value, b bool) + func SetNull(v *Value) + func SetNumber(v *Value, n float64) + func SetObject(v *Value) + func SetString(v *Value, s string) + func SetValueByPointer(v *Value, pointerStr string, value *Value) error + func ShrinkArray(v *Value) + func ShrinkObject(v *Value) + func Swap(lhs, rhs *Value) + type CircularReplacer func(path []string) *Value + type CycleError int + const CYCLE_DETECTED + const CYCLE_OK + func DetectCycle(v *Value) CycleError + func SafeCopy(dst, src *Value) CycleError + func (e CycleError) Error() string + type EnhancedError struct + Code ParseError + Column int + Context string + IsRecoverable bool + Line int + Message string + Pointer string + SourceInput string + func (e *EnhancedError) Error() string + type JSONPatch struct + Operations []PatchOperation + func CreatePatch(source, target *Value) (*JSONPatch, error) + func NewJSONPatch(patchDoc *Value) (*JSONPatch, error) + func NewJSONPatchFromString(patchStr string) (*JSONPatch, error) + func (p *JSONPatch) Apply(doc *Value) error + func (p *JSONPatch) String() (string, error) + type JSONPath struct + Path string + Tokens []Token + func NewJSONPath(path string) (*JSONPath, error) + func (jp *JSONPath) Query(doc *Value) ([]*Value, error) + func (jp *JSONPath) QueryOne(doc *Value) (*Value, error) + type JSONPathError struct + Index int + Message string + Path string + func (e JSONPathError) Error() string + type JSONPointer struct + func GetJSONPointer(segments ...interface{}) (*JSONPointer, error) + func (p *JSONPointer) Get(root *Value) (*Value, JSONPointerError) + func (p *JSONPointer) Insert(root *Value, value *Value) JSONPointerError + func (p *JSONPointer) Remove(root *Value) JSONPointerError + func (p *JSONPointer) Replace(root *Value, value *Value) JSONPointerError + func (p *JSONPointer) String() string + type JSONPointerError int + const POINTER_INDEX_OUT_OF_RANGE + const POINTER_INVALID_FORMAT + const POINTER_INVALID_TARGET + const POINTER_KEY_NOT_FOUND + const POINTER_OK + func (e JSONPointerError) Error() string + type JSONSchema struct + Schema *Value + func NewJSONSchema(schemaJSON string) (*JSONSchema, error) + func NewJSONSchemaFromValue(schema *Value) (*JSONSchema, error) + func (js *JSONSchema) Validate(data *Value) *SchemaValidationResult + type Member struct + K string + V *Value + type ParseError int + const PARSE_COMMENT_NOT_CLOSED + const PARSE_EXPECT_VALUE + const PARSE_INVALID_STRING_CHAR + const PARSE_INVALID_STRING_ESCAPE + const PARSE_INVALID_UNICODE_HEX + const PARSE_INVALID_UNICODE_SURROGATE + const PARSE_INVALID_VALUE + const PARSE_MAX_DEPTH_EXCEEDED + const PARSE_MISS_COLON + const PARSE_MISS_COMMA_OR_CURLY_BRACKET + const PARSE_MISS_COMMA_OR_SQUARE_BRACKET + const PARSE_MISS_KEY + const PARSE_MISS_QUOTATION_MARK + const PARSE_NUMBER_TOO_BIG + const PARSE_OK + const PARSE_ROOT_NOT_SINGULAR + func Parse(v *Value, json string) ParseError + func ParseWithOptions(v *Value, json string, options ParseOptions) ParseError + func (e ParseError) Error() string + type ParseOptions struct + AllowComments bool + AllowTrailing bool + MaxDepth int + RecoverFromErrors bool + StrictMode bool + func DefaultParseOptions() ParseOptions + type PatchError struct + Message string + Operation string + Path string + func (e PatchError) Error() string + type PatchOperation struct + From string + Op string + Path string + Value *Value + type SchemaValidationError struct + Message string + Path string + func (e SchemaValidationError) Error() string + type SchemaValidationResult struct + Errors []SchemaValidationError + Valid bool + func (r *SchemaValidationResult) AddError(path, message string) + type SliceInfo struct + End int + Start int + Step int + type StringifyError int + const STRINGIFY_OK + func Stringify(v *Value) (string, StringifyError) + func (e StringifyError) Error() string + type Token struct + Type TokenType + Value string + type TokenType int + const BRACKET_END + const BRACKET_START + const CURRENT + const DOT + const FILTER + const INDEX + const PROPERTY + const RECURSIVE_DESCENT + const ROOT + const SLICE + const UNION + const WILDCARD + type Value struct + A []*Value + N float64 + O []Member + S string + Type ValueType + func DefaultCircularReplacer(path []string) *Value + func FindObjectKey(v *Value, key string) (*Value, bool) + func GetArrayElement(v *Value, index int) *Value + func GetObjectValue(v *Value, index int) *Value + func GetObjectValueByKey(v *Value, key string) *Value + func GetValueByPointer(v *Value, pointerStr string) (*Value, error) + func InsertArrayElement(v *Value, index int) *Value + func PushBackArrayElement(v *Value) *Value + func QueryOneString(doc *Value, path string) (*Value, error) + func QueryString(doc *Value, path string) ([]*Value, error) + func SetObjectValue(v *Value, key string) *Value + func (v Value) String() string + type ValueType int + const ARRAY + const FALSE + const NULL + const NUMBER + const OBJECT + const STRING + const TRUE + func GetType(v *Value) ValueType