Documentation ¶
Index ¶
- type AbstractMarshaler
- type BufferContext
- type DummyMarshaller
- func (d *DummyMarshaller) DescribeItem(i int) string
- func (d *DummyMarshaller) Len() int
- func (d *DummyMarshaller) Marshal() ([]byte, error)
- func (d *DummyMarshaller) MarshalJSON() ([]byte, error)
- func (d *DummyMarshaller) SplitPayload(int) ([]AbstractMarshaler, error)
- func (d *DummyMarshaller) WriteFooter(stream *jsoniter.Stream) error
- func (d *DummyMarshaller) WriteHeader(stream *jsoniter.Stream) error
- func (d *DummyMarshaller) WriteItem(stream *jsoniter.Stream, i int) error
- type IterableStreamJSONMarshaler
- type IterableStreamJSONMarshalerAdapter
- func (a *IterableStreamJSONMarshalerAdapter) DescribeCurrentItem() string
- func (a *IterableStreamJSONMarshalerAdapter) GetCurrentItemPointCount() int
- func (a *IterableStreamJSONMarshalerAdapter) MoveNext() bool
- func (a *IterableStreamJSONMarshalerAdapter) WriteCurrentItem(j *jsoniter.Stream) error
- func (a *IterableStreamJSONMarshalerAdapter) WriteFooter(j *jsoniter.Stream) error
- func (a *IterableStreamJSONMarshalerAdapter) WriteHeader(j *jsoniter.Stream) error
- type JSONMarshaler
- type ProtoMarshaler
- type StreamJSONMarshaler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AbstractMarshaler ¶
type AbstractMarshaler interface { // SplitPayload breaks the payload into times number of pieces SplitPayload(int) ([]AbstractMarshaler, error) }
AbstractMarshaler is an abstract marshaler.
type BufferContext ¶
type BufferContext struct { CompressorInput *bytes.Buffer CompressorOutput *bytes.Buffer PrecompressionBuf *bytes.Buffer }
BufferContext contains the buffers used for MarshalSplitCompress so they can be shared between invocations
func NewBufferContext ¶
func NewBufferContext() *BufferContext
NewBufferContext initialize the default compression buffers
type DummyMarshaller ¶
DummyMarshaller implements StreamJSONMarshaler for unit tests.
func (*DummyMarshaller) DescribeItem ¶
func (d *DummyMarshaller) DescribeItem(i int) string
DescribeItem returns a text description for logs
func (*DummyMarshaller) Len ¶
func (d *DummyMarshaller) Len() int
Len returns the number of items to marshal
func (*DummyMarshaller) Marshal ¶
func (d *DummyMarshaller) Marshal() ([]byte, error)
Marshal not implemented
func (*DummyMarshaller) MarshalJSON ¶
func (d *DummyMarshaller) MarshalJSON() ([]byte, error)
MarshalJSON not implemented
func (*DummyMarshaller) SplitPayload ¶
func (d *DummyMarshaller) SplitPayload(int) ([]AbstractMarshaler, error)
SplitPayload not implemented
func (*DummyMarshaller) WriteFooter ¶
func (d *DummyMarshaller) WriteFooter(stream *jsoniter.Stream) error
WriteFooter writes the payload footer for this type
func (*DummyMarshaller) WriteHeader ¶
func (d *DummyMarshaller) WriteHeader(stream *jsoniter.Stream) error
WriteHeader writes the payload header for this type
type IterableStreamJSONMarshaler ¶
type IterableStreamJSONMarshaler interface { WriteHeader(*jsoniter.Stream) error WriteCurrentItem(*jsoniter.Stream) error DescribeCurrentItem() string MoveNext() bool GetCurrentItemPointCount() int }
IterableStreamJSONMarshaler is an interface for iterable metrics that are able to serialize themselves in a stream. Expected usage:
m.WriteHeader(stream) for m.MoveNext() { m.WriteCurrentItem(stream) } m.WriteFooter(stream)
type IterableStreamJSONMarshalerAdapter ¶
type IterableStreamJSONMarshalerAdapter struct {
// contains filtered or unexported fields
}
IterableStreamJSONMarshalerAdapter adapts an object implementing `StreamJSONMarshaler` into an object implementing `IterableStreamJSONMarshaler`
func NewIterableStreamJSONMarshalerAdapter ¶
func NewIterableStreamJSONMarshalerAdapter(marshaler StreamJSONMarshaler) *IterableStreamJSONMarshalerAdapter
NewIterableStreamJSONMarshalerAdapter creates an new instance of `IterableStreamJSONMarshalerAdapter`
func (*IterableStreamJSONMarshalerAdapter) DescribeCurrentItem ¶
func (a *IterableStreamJSONMarshalerAdapter) DescribeCurrentItem() string
DescribeCurrentItem returns a text description
func (*IterableStreamJSONMarshalerAdapter) GetCurrentItemPointCount ¶
func (a *IterableStreamJSONMarshalerAdapter) GetCurrentItemPointCount() int
GetCurrentItemPointCount gets the number of points in the current item
func (*IterableStreamJSONMarshalerAdapter) MoveNext ¶
func (a *IterableStreamJSONMarshalerAdapter) MoveNext() bool
MoveNext moves to the next value. Returns false when reaching the end of the iteration.
func (*IterableStreamJSONMarshalerAdapter) WriteCurrentItem ¶
func (a *IterableStreamJSONMarshalerAdapter) WriteCurrentItem(j *jsoniter.Stream) error
WriteCurrentItem writes the json representation into the stream
func (*IterableStreamJSONMarshalerAdapter) WriteFooter ¶
func (a *IterableStreamJSONMarshalerAdapter) WriteFooter(j *jsoniter.Stream) error
WriteFooter writes the payload footer for this type
func (*IterableStreamJSONMarshalerAdapter) WriteHeader ¶
func (a *IterableStreamJSONMarshalerAdapter) WriteHeader(j *jsoniter.Stream) error
WriteHeader writes the payload header for this type
type JSONMarshaler ¶
type JSONMarshaler interface { AbstractMarshaler // MarshalJSON serialization a Payload to JSON MarshalJSON() ([]byte, error) }
JSONMarshaler is a AbstractMarshaler that implement JSON marshaling.
type ProtoMarshaler ¶
type ProtoMarshaler interface { AbstractMarshaler // Marshal serialize objects using agent-payload definition. Marshal() ([]byte, error) }
ProtoMarshaler is a AbstractMarshaler that implement proto marshaling.