inputdummy

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package inputdummy simulates artificial trice data for testing.

On creation a byte slice with mockup data is expected. When end of slice is reached reading starts from the beginning. The time.Duration value can be used to delay the Read function.

Index

Constants

View Source
const (
	// NoDelay avoids any internal waiting.
	NoDelay = time.Duration(0)

	// NoLimit is used for limit and means endless (circular) data.
	NoLimit = 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Source

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

Source delivers an endless circle of bytes.

func New

func New(b []byte, t time.Duration, limit int) *Source

New creates an instance of inputDummy. b contains bytes it reads cyclically

func (*Source) Read

func (p *Source) Read(b []byte) (int, error)

Read is an exported method.

Jump to

Keyboard shortcuts

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