takoprint

package
v0.0.0-...-6e85980 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Callback

func Callback(cb CallbackDataFunc) func(*Takoprint)

Callback configures an event callback consumer

func Logger

func Logger(l *log.Logger) func(*Takoprint)

Logger configures a custom logger instance.

Types

type CallbackData

type CallbackData struct {
	LastSent string
	NumSent  int
	Reply    string
}

type CallbackDataFunc

type CallbackDataFunc func(*CallbackData)

type Takoprint

type Takoprint struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New(s io.ReadWriteCloser, f io.Reader, opts ...func(*Takoprint)) *Takoprint

New returns a new takoprint instance.

func (*Takoprint) Echo

func (tp *Takoprint) Echo(str string)

Echo prints a string on the printer screen.

func (*Takoprint) Start

func (tp *Takoprint) Start(ctx context.Context)

Start feeds input data to the serial output.

Jump to

Keyboard shortcuts

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