Documentation ¶
Overview ¶
Package stream provides utility functions to consume Entry streams.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadEntries ¶
ReadEntries reads a stream of Entry protobufs from r.
func ReadJSONEntries ¶
ReadJSONEntries reads a JSON stream of Entry protobufs from r.
func StructuredFactValueJSON ¶ added in v0.0.27
func StructuredFactValueJSON(e *spb.Entry) (json.RawMessage, error)
StructuredFactValueJSON creates a json object from e.FactValue
Types ¶
type EntryReader ¶ added in v0.0.22
EntryReader functions read a stream of entries, passing each to a handler function.
func NewJSONReader ¶ added in v0.0.22
func NewJSONReader(r io.Reader) EntryReader
NewJSONReader reads a JSON stream of Entry protobufs from r.
func NewReader ¶ added in v0.0.22
func NewReader(r io.Reader) EntryReader
NewReader reads a stream of Entry protobufs from r.
func NewStructuredJSONReader ¶ added in v0.0.27
func NewStructuredJSONReader(r io.Reader) EntryReader
NewStructuredJSONReader reads a JSON stream of StructuredEntry protobufs from r.
type StructuredEntry ¶ added in v0.0.27
StructuredEntry has custom marshaling behavior to handle structured FactValues
func Structured ¶ added in v0.0.27
func Structured(e *spb.Entry) *StructuredEntry
Structured creates an entry that serializes factValue to a full value
func (*StructuredEntry) MarshalJSON ¶ added in v0.0.27
func (r *StructuredEntry) MarshalJSON() ([]byte, error)
MarshalJSON marshals r including an object representation of FactValue when appropriate
func (*StructuredEntry) ProtoMessage ¶ added in v0.0.27
func (r *StructuredEntry) ProtoMessage()
ProtoMessage calls the implementation for Entry
func (*StructuredEntry) Reset ¶ added in v0.0.27
func (r *StructuredEntry) Reset()
Reset calls the implementation for Entry
func (*StructuredEntry) String ¶ added in v0.0.27
func (r *StructuredEntry) String() string
String calls the implementation for Entry
func (*StructuredEntry) UnmarshalJSON ¶ added in v0.0.27
func (r *StructuredEntry) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals r including an object representation of FactValue when appropriate