runner

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitTimeout     = -1
	ExitACK         = 0
	ExitFailed      = 1
	ExitNACK        = 3
	ExitNACKRequeue = 4
	ExitRetry       = 5
)

Exit constants used to know how handle the message. The consumer runnig is the responsible to understand this status and handle them properly.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Type         string  `mapstructure:"type"`
	IgnoreOutput bool    `mapstructure:"ignore-output"`
	Options      Options `mapstructure:"options"`
}

Config is an composition of all options and configurations used by this runnables.

type Options

type Options struct {
	Path string   `mapstructure:"path"`
	Args []string `mapstructure:"args"`
}

type Runnable

type Runnable interface {
	Process(context.Context, []byte) int
}

Runnable represent an runnable used by consumers to handle messages.

func New

func New(log *zap.Logger, c Config) (Runnable, error)

New create and return a Runnable based on the config type. if the type didn't exist an error is returned.

Jump to

Keyboard shortcuts

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