feeder

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxTries = 5
	DefaultBackoff  = 100 * time.Millisecond
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Feeder

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

func New

func New(maxTries int, backoff time.Duration, jobID string, writer serial.Writer) *Feeder

func (*Feeder) Feed

func (f *Feeder) Feed(ctx context.Context, instructions []string, statFn StatFn) error

func (*Feeder) WriteInstruction

func (f *Feeder) WriteInstruction(ctx context.Context, instruction string, statFn StatFn, currentStats *Stats) error

type StatFn

type StatFn = func(stats Stats) (err error)

type Stats

type Stats struct {
	JobID        string
	FatalError   error
	Line         int
	Total        int
	CurrentTry   int
	CurrentTotal int
	CurrentRest  int
}

Jump to

Keyboard shortcuts

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