Documentation ¶
Index ¶
- Constants
- Variables
- func BoolSize(b bool) uint32
- func GCD_U16(a, b uint16) uint16
- func MarshalBool(v bool) (buf []byte)
- func MarshalString(str string) (buf []byte)
- func MillisToUTCTime(millis uint64) time.Time
- func NullableSize(o dmeta.Field) uint32
- func OptionalBoolSize(b *bool) uint32
- func OptionalSize(o dmeta.Field) uint32
- func OptionalStringSize(s *string) uint32
- func OptionalTimeSize(t *time.Time) uint32
- func StringSize(s string) uint32
- func TriStateStringSize(s *string, null bool) uint32
- func UTCTimeToMillis(t *time.Time) *uint64
- func UnmarshalString(val []byte) (string, error)
- func UnmarshalStringInto(val []byte, to *string) error
- type OutBuilder
- func (o OutBuilder) NullSlice(k serial.Key, null bool, v interface{}) OutBuilder
- func (o OutBuilder) Nullable(k serial.Key, v interface{}) OutBuilder
- func (o OutBuilder) OptSlice(k serial.Key, empty bool, v interface{}) OutBuilder
- func (o OutBuilder) Optional(k serial.Key, v interface{}) OutBuilder
- func (o OutBuilder) RawValue(k serial.Key, v interface{}) OutBuilder
- func (o OutBuilder) TriState(k serial.Key, null bool, v interface{}) OutBuilder
Constants ¶
View Source
const ( Millis2Seconds = 1_000 Millis2Nano = 1_000_000 )
Variables ¶
View Source
var ( ErrTooShort = errors.New("value is too short to be a valid JSON string") ErrBadFmt = errors.New("badly formatted JSON string") )
Functions ¶
func MarshalBool ¶
func MarshalString ¶
func MillisToUTCTime ¶
func NullableSize ¶
func OptionalBoolSize ¶
func OptionalSize ¶
func OptionalStringSize ¶
OptionalStringSize returns either 0 if the given value is nil, or len(*value) + 2 (for quotes).
func OptionalTimeSize ¶
func TriStateStringSize ¶
TriStateStringSize returns the size in bytes of the given value for the three possible states: absent, null, populated.
If the given value is nil and null is false, returns 0 (absent).
If the given value is nil and null is true, returns 4 (len("null")).
If the given value is non-nil, len(*value) + 2 (for quotes) is returned.
func UTCTimeToMillis ¶
func UnmarshalStringInto ¶
Types ¶
type OutBuilder ¶
func (OutBuilder) NullSlice ¶
func (o OutBuilder) NullSlice(k serial.Key, null bool, v interface{}) OutBuilder
func (OutBuilder) Nullable ¶
func (o OutBuilder) Nullable(k serial.Key, v interface{}) OutBuilder
func (OutBuilder) OptSlice ¶
func (o OutBuilder) OptSlice(k serial.Key, empty bool, v interface{}) OutBuilder
func (OutBuilder) Optional ¶
func (o OutBuilder) Optional(k serial.Key, v interface{}) OutBuilder
func (OutBuilder) RawValue ¶
func (o OutBuilder) RawValue(k serial.Key, v interface{}) OutBuilder
func (OutBuilder) TriState ¶
func (o OutBuilder) TriState(k serial.Key, null bool, v interface{}) OutBuilder
Click to show internal directories.
Click to hide internal directories.