stdout

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package printer defines printer output and error carriers. These are mainly useful for debugging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytePrinter

func BytePrinter(in []byte) (out string)

BytePrinter attempts to convert bytes to strings.

func WrapperPrinter

func WrapperPrinter(w *flow.Wrapper) (out string)

WrapperPrinter attempts to deserialise a wrapper protobuf and returns a formatted overview.

Types

type Carrier

type Carrier struct {
	Context      context.Context
	Logger       journal.Logger
	Deserialiser func(w *flow.Wrapper) (out string)
}

func New

func New(ctx context.Context, logger journal.Logger, config *Config) (*Carrier, error)

func (*Carrier) ValidErrorCarrier added in v0.0.10

func (c *Carrier) ValidErrorCarrier() error

func (*Carrier) WriteErr

func (c *Carrier) WriteErr(message *flow.MessageContext) error

func (*Carrier) WriteFail

func (c *Carrier) WriteFail(message *flow.MessageContext) error

func (*Carrier) WriteOutput

func (c *Carrier) WriteOutput(message *flow.MessageContext) error

type Config

type Config struct {
	// Deserialiser is the deserialisation function, it will get passed the byte array
	// that is being passed to the output and returns a string to be printed.
	// Defaults to BytePrinter
	Deserialiser func(w *flow.Wrapper) (out string)
}

Config structure for the printer carriers.

Jump to

Keyboard shortcuts

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