stream

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2019 License: Apache-2.0, NCSA Imports: 11 Imported by: 9

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

func ReadEntries(r io.Reader) <-chan *spb.Entry

ReadEntries reads a stream of Entry protobufs from r.

func ReadJSONEntries

func ReadJSONEntries(r io.Reader) <-chan *spb.Entry

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

type EntryReader func(func(*spb.Entry) error) error

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

type StructuredEntry spb.Entry

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

Jump to

Keyboard shortcuts

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