Tags: tinylib/msgp
Tags
Ignore complexity of children in maps/slices (#382) When considering inlining maps/slices/arrays, apply a fixed cost and ignore the cost of the children. If children are too expensive, they will not be inlined, but it shouldn't affect whether the map itself is inlined. This only really applies when a map or slice type is aliased, otherwise it will not be considered for inlining. Fixes #381
Add "newtime" directive to use official messagepack time format (#378) This adds `msgp:newtime` file directive that will encode all time fields using the -1 extension as defined in the [(revised) messagepack spec](https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type) ReadTime/ReadTimeBytes will now support both types natively, and will accept either as input. Extensions should remain unaffected. Fixes #300
Add native json.Number support (#364) Allow encoding and decoding of `json.Number` values, either as struct members or as interface members. Numbers will be encoded as integer, if possible, otherwise float64/float32 is used. The zero value json.Number will be encoded as 0. It is possible to encode as string with `//msgp:replace json.Number with:string`. Fixes #292
Add recursion limit for dynamic code (#358) Prevent stack exhaustion on: Decoder: * CopyNext * Skip * ReadIntf * ReadMapStrIntf * WriteToJSON Standalone: * Skip * ReadMapStrIntfBytes * ReadIntfBytes * CopyToJSON * UnmarshalAsJSON Limit is set to 100K recursive map/slice operations.
`replace` directive (#346) Adds a `replace` directive that makes it easier to serialize foreign types. Example usage with github.com/google/uuid ```go package main import "github.com/google/uuid" //go:generate msgp //msgp:replace uuid.UUID with:UUID type UUID [16]byte // Or like that //msgp:replace uuid.UUID with:[16]byte type User struct { ID uuid.UUID } ```
README: update link to docs website, and add docs reference badge godoc.org moved to pkg.go.dev, so updating the link; while updating the file also added a badge to link to the module's reference on pkg.go.dev. Signed-off-by: Sebastiaan van Stijn <[email protected]>
PreviousNext