{"modulePath":"github.com/kaptinlin/jsonpatch","version":"v0.7.10","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package binary\n\nPackage binary implements a MessagePack-based binary codec for JSON Patch operations.\n\nThe binary codec uses the same operation tree as the compact codec: paths are encoded as segment arrays, optional true flags use integer 1 while false fields are omitted, and composite predicate children use paths relative to the containing predicate path.\n\n## Variables\n\n```go\nvar (\n\t// ErrUnsupportedOp indicates an unknown or unsupported operation code.\n\tErrUnsupportedOp = errors.New(\"unsupported operation code\")\n\t// ErrInvalidPredicate indicates a composite predicate contains a non-predicate operation.\n\tErrInvalidPredicate = errors.New(\"invalid predicate operation\")\n\t// ErrNotSinglePredicate indicates a not operation has anything other than one child predicate.\n\tErrNotSinglePredicate = errors.New(\"not operation requires exactly one predicate\")\n\t// ErrInvalidTestTypeFormat indicates invalid types array for test_type predicate.\n\tErrInvalidTestTypeFormat = errors.New(\"invalid test_type types format\")\n\t// ErrInvalidValueType indicates the decoded value has an unexpected type.\n\tErrInvalidValueType = errors.New(\"invalid value type\")\n\t// ErrMapKeyNotString indicates a MessagePack object contains a non-string key.\n\tErrMapKeyNotString = errors.New(\"map key must be a string\")\n\t// ErrInvalidFrameArity indicates an operation frame has the wrong number of fields.\n\tErrInvalidFrameArity = errors.New(\"invalid operation frame arity\")\n\t// ErrInvalidTrueMarker indicates an optional true flag is not encoded as integer 1.\n\tErrInvalidTrueMarker = errors.New(\"binary optional true marker must be integer 1\")\n\t// ErrTrailingData indicates bytes remain after a complete patch value.\n\tErrTrailingData = errors.New(\"trailing data after patch\")\n\t// ErrNumberNotFinite indicates a coordinate is NaN or infinite.\n\tErrNumberNotFinite = errors.New(\"numeric field must be finite\")\n\t// ErrNumberNotInteger indicates a coordinate has a fractional component.\n\tErrNumberNotInteger = errors.New(\"coordinate field must be an integer\")\n\t// ErrNumberOutOfRange indicates a coordinate cannot be represented as int.\n\tErrNumberOutOfRange = errors.New(\"coordinate field is outside the int range\")\n)\n```\n\n## Types\n\n```go\ntype Codec struct{}\n```\nCodec encodes and decodes JSON Patch operations in MessagePack binary format.\n\n```go\nfunc New() *Codec\n```\nNew creates a new binary Codec.\n\n```go\nfunc (c *Codec) Decode(data []byte) ([]internal.Op, error)\n```\nDecode deserializes operations from MessagePack binary format.\n\n```go\nfunc (c *Codec) Encode(ops []internal.Op) ([]byte, error)\n```\nEncode serializes operations into MessagePack binary format.\n\n","path":"github.com/kaptinlin/jsonpatch/codec/binary","name":"binary","synopsis":"Package binary implements a MessagePack-based binary codec for JSON Patch operations.","isRedistributable":true}
