generator

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package generator contains an implementation of a in memory generator that generates payloads in json format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMemGen

func NewMemGen(vertexInstance *dfv1.VertexInstance,
	rpu int,
	msgSize int32,
	timeunit time.Duration,
	writers []isb.BufferWriter,
	fetchWM fetch.Fetcher, publishWM map[string]publish.Publisher, publishWMStores *generic.PublishWMStores,
	opts ...Option) (*memgen, error)

NewMemGen fuction creates an instance of generator. ctx - context passed by the cmd/start.go a new context with cancel

is created for use by this vertex.

name - name of this vertex rpu - no of records to generate per time unit. by default the channel buffer size is set to 5*rpu msgSize - size of each generated message timeunit - unit of time per tick. could be any golang time.Duration. writers - destinations to write to

Types

type Option

type Option func(*memgen) error

func WithLogger

func WithLogger(l *zap.SugaredLogger) Option

WithLogger is used to return logger information

func WithReadTimeOut

func WithReadTimeOut(timeout time.Duration) Option

Jump to

Keyboard shortcuts

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