Help us shape the future of Go! Take the 2026 Go Developer Survey

jsonutil

package
v0.315.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalFloat added in v0.44.0

func MarshalFloat(f float64, stream *jsoniter.Stream)

MarshalFloat marshals a float value using the passed jsoniter stream.

func MarshalHistogram added in v0.44.0

func MarshalHistogram(h *histogram.FloatHistogram, stream *jsoniter.Stream)

MarshalHistogram marshals a histogram value using the passed jsoniter stream. It writes something like:

{
    "count": "42",
    "sum": "34593.34",
    "buckets": [
      [ 3, "-0.25", "0.25", "3"],
      [ 0, "0.25", "0.5", "12"],
      [ 0, "0.5", "1", "21"],
      [ 0, "2", "4", "6"]
    ]
}

The 1st element in each bucket array determines if the boundaries are inclusive (AKA closed) or exclusive (AKA open):

0: lower exclusive, upper inclusive
1: lower inclusive, upper exclusive
2: both exclusive
3: both inclusive

The 2nd and 3rd elements are the lower and upper boundary. The 4th element is the bucket count.

func MarshalTimestamp

func MarshalTimestamp(t int64, stream *jsoniter.Stream)

MarshalTimestamp marshals a point timestamp using the passed jsoniter stream.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL