kafkatokafka

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONBuilder

type JSONBuilder struct {
	fbcontext.ContextAware
}

JSONBuilder is a firebolt `node.SyncNode` for building JSON extracts from syslog messages. Because this is a `node.SyncNode`, its 'Process()' method must return immediately. A `node.AsyncNode` interface is also available for async operations such as bulk db writes.

func (*JSONBuilder) Process

func (j *JSONBuilder) Process(event *firebolt.Event) (*firebolt.Event, error)

Process takes the inbound `msg`, a captainslog.SyslogMsg, and builds a JSON string from it, returning that string as a []byte.

func (*JSONBuilder) Receive

func (j *JSONBuilder) Receive(msg fbcontext.Message) error

Receive handles a message from another node or an external source. This example doesn't use messaging.

func (*JSONBuilder) Setup

func (j *JSONBuilder) Setup(config map[string]string) error

Setup is a no-op in jsonbuilder. This is where you'd do any one-time setup, like establishing a db connection or populating a cache.

func (*JSONBuilder) Shutdown

func (j *JSONBuilder) Shutdown() error

Shutdown is a no-op in jsonbuilder. This is where you'd clean up any resources on application shutdown.

type Parser

type Parser struct {
	fbcontext.ContextAware
}

Parser is a firebolt `node.SyncNode` for parsing syslog messages from bytes using `digitalocean/captainslog`. Because this is a `node.SyncNode`, its 'Process()' method must return immediately. A `node.AsyncNode` interface is also available for async operations such as bulk db writes.

func (*Parser) Process

func (p *Parser) Process(event *firebolt.Event) (*firebolt.Event, error)

Process performs whatever work this node does on each event as it arrives. This example takes the inbound `msg`, which is a byte array, and parses a `captainslog.SyslogMsg` from it.

func (*Parser) Receive

func (p *Parser) Receive(msg fbcontext.Message) error

Receive handles a message from another node or an external source. This example doesn't use messaging.

func (*Parser) Setup

func (p *Parser) Setup(config map[string]string) error

Setup is a no-op in parser. This is where you'd do any one-time setup, like establishing a db connection or populating a cache.

func (*Parser) Shutdown

func (p *Parser) Shutdown() error

Shutdown is a no-op in parser. This is where you'd clean up any resources on application shutdown.

Jump to

Keyboard shortcuts

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