json

package
v0.0.0-...-5d6a5f9 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChunkStream

func ChunkStream(in <-chan interface{}, out chan<- interface{}, errs chan<- error)

ChunkStream reads out multiple json blocks from a stream of json blocks turning each block into it's own downstream message.

func From

func From(msg interface{}) (interface{}, error)

From converts the json message to a map string interface

func FromAs

func FromAs(ptr interface{}) func(interface{}) (interface{}, error)

FromAs converts the json message to an instance of the type of the passed pointer

func To

func To(msg interface{}) (interface{}, error)

To converts the message to a json message

Types

type StreamChunk

type StreamChunk struct {
	Src    interface{}
	Offset int
	Bytes  []byte
}

StreamChunk is a struct that has the block found in the stream as well as the position in the stream

func (StreamChunk) String

func (s StreamChunk) String() string

String makes this struct a fmt.Stringer

Jump to

Keyboard shortcuts

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