json

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package json implements a parser for json serialized records

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser implements a parser for json serialized records

func NewParser

func NewParser(c *ParserConfig) (*Parser, error)

NewParser returns a new json parser

func (*Parser) Parse

func (p *Parser) Parse(objects chan *replay.Object, entries chan *kinesis.PutRecordsRequestEntry)

Parse spawns a pool of workers that process the incoming stream of objects, performing parsing and filtering logic before publishing to the entries stream. Parse blocks until all objects have been parsed and emitted.

type ParserConfig

type ParserConfig struct {
	Concurrency  int                `validate:"required,min=1"`
	Delimiter    *regexp.Regexp     `validate:"-"`
	Log          logrus.FieldLogger `validate:"required"`
	PartitionKey string             `validate:"required"`
	Replace      *regexp.Regexp     `validate:"-"`
	ReplaceWith  string             `validate:"-"`
	Schema       string             `validate:"-"`
}

ParserConfig defines a json parser's configuration

func NewParserConfig

func NewParserConfig() *ParserConfig

NewParserConfig returns a new config value with appropriate defaults

Jump to

Keyboard shortcuts

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