dispatch

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package dispatch simply contains any built-in instances of DispatcherFunc. A DispatcherFunc is a "registered, user-authored function" that conducts the final act of the shunt message routing process: *Item dispatch.

To date, there is only one built-in instance of DispatcherFunc: dispatch.Stdout. Though usable, it is largely unhelpful beyond demonstrative reference regarding the authoring of new DispatchFuncs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Stdout

func Stdout(sb SmartBuffer, cfg map[string]interface{}) (bool, error)

Stdout is simply an example wrapper for the "fmt" package that happens to be usable. If you're writing your own DispatchFunc, chances are it will be a lot more useful than this one, but this is still a good reference.

Types

type BufferEntry

type BufferEntry []byte

The BufferEntry type is an alias of []byte. It represents a single "entry" within a buffer.

type SmartBuffer

type SmartBuffer []BufferEntry

The SmartBuffer type is an alias, and acts as an array of []BufferEntry literal instances.

When dealing with a SmartBuffer, one may iterate through it and deal with each individual BufferEntry as seen fit.

// Assuming sb is your SmartBuffer var ...
for entry := range sb {
	// ... do stuff ... //
}

func (SmartBuffer) DumpBytes

func (sb SmartBuffer) DumpBytes(newlines bool) []byte

DumpBytes will return the entire buffer contents, with or without individual per-entry line-breaks, as one []byte value.

Useful for batched writes, particularly in high-volume situations.

func (SmartBuffer) DumpString

func (sb SmartBuffer) DumpString(newlines bool) string

DumpString will return the entire buffer contents, with or without individual per-entry line-breaks, as one string value.

Useful for batched writes, particularly in high-volume situations.

Jump to

Keyboard shortcuts

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