Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SizeLimit ¶ added in v0.86.0
type SizeLimit uint8
SizeLimit is a bitmap of the payload size limits exceeded by a serialized payload.
const ( // CompressedLimit is set when the compressed payload exceeds maxPayloadSizeCompressed. CompressedLimit SizeLimit = 1 << iota // UncompressedLimit is set when the uncompressed payload exceeds maxPayloadSizeUnCompressed. UncompressedLimit // WithinLimits means the payload exceeds no size limit. WithinLimits SizeLimit = 0 )
func CheckSizeAndSerialize ¶
func CheckSizeAndSerialize(m marshaler.JSONMarshaler, compress bool, strategy compression.Component) (SizeLimit, []byte, []byte, error)
CheckSizeAndSerialize Check the size of a payload and marshall it (optionally compress it) The dual role makes sense as you will never serialize without checking the size of the payload The returned SizeLimit has a bit set for each limit exceeded by the payload, it is WithinLimits if the payload doesn't need to be split.