randomProxyPrinter

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string
const (
	IncrementValue   Action = "increment"
	DecrementValue   Action = "decrement"
	PrintRandomProxy Action = "print"
)

type Displayer

type Displayer interface {
	Display(int) error
}

type ESCPOSPrinter

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

func NewESCPOSPrinter

func NewESCPOSPrinter(escpos *escpos.Escpos, logger *logrus.Entry) *ESCPOSPrinter

func (*ESCPOSPrinter) Print

func (t *ESCPOSPrinter) Print(proxy Proxy) error

type GpioInput

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

func NewGpioInput

func NewGpioInput(button *buttonDevice.Button, rotaryEncoder *rotaryEncoderDevice.RotaryEncoder, logger *logrus.Entry) *GpioInput

func (*GpioInput) Run

func (t *GpioInput) Run(parentCtx context.Context, actions chan<- Action) error

type HT16K33Display

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

func NewHT16K33Display

func NewHT16K33Display(ht16k33 *device.I2cHt16k33) *HT16K33Display

func (*HT16K33Display) Display

func (t *HT16K33Display) Display(number int) error

type Inputter

type Inputter interface {
	Run(context.Context, chan<- Action) error
}

type KY040Inputter

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

func NewKY040Inputter

func NewKY040Inputter(rotaryEncoder *device.RotaryEncoder) *KY040Inputter

func (*KY040Inputter) Run

func (k *KY040Inputter) Run(ctx context.Context, actions chan<- Action) error

type Printer

type Printer interface {
	Print(Proxy) error
}

type Proxy

type Proxy struct {
	Name        string
	Description string
	PrintData   []byte
}

type RandomProxyPrinter

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

func NewRandomProxyPrinter

func NewRandomProxyPrinter(db *sql.DB,
	displayer Displayer,
	inputter Inputter,
	printer Printer,
	logger *logrus.Entry) *RandomProxyPrinter

func (*RandomProxyPrinter) Run

func (t *RandomProxyPrinter) Run(parentCtx context.Context) error

type StdoutDisplay

type StdoutDisplay struct {
	Logger *logrus.Logger
}

func (*StdoutDisplay) Display

func (t *StdoutDisplay) Display(number int) error

type StdoutPrinter

type StdoutPrinter struct {
	Logger *logrus.Logger
}

func (*StdoutPrinter) Print

func (t *StdoutPrinter) Print(proxy Proxy) error

Jump to

Keyboard shortcuts

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