xprocessor

package
v0.6.9 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

README

This package should be used only by external binaries to build some xProcessors

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Envs map[string]string
View Source
var Logger = log.New(os.Stderr, "", 0)

Functions

This section is empty.

Types

type Option

type Option struct {
	Name         string      `json:"name"`
	Alias        string      `json:"alias"`
	Doc          string      `json:"doc"`
	Required     bool        `json:"required"`
	Type         string      `json:"type"`
	DefaultValue interface{} `json:"default_value"`
	ExampleLS    string      `json:"example"`
	Value        interface{} `json:"-"`
}

func (*Option) Default

func (o *Option) Default() []string

type Options

type Options map[string]*Option

func (Options) Bool

func (o Options) Bool(name string) bool

func (Options) Int

func (o Options) Int(name string) int

func (Options) IntSlice

func (o Options) IntSlice(name string) []int

func (Options) MapString

func (o Options) MapString(name string) map[string]string

func (Options) String

func (o Options) String(name string) string

func (Options) StringSlice

func (o Options) StringSlice(name string) []string

func (Options) Value

func (o Options) Value(name string) interface{}

type Runner

type Runner struct {
	Opt Options

	Description      string
	ShortDescription string
	// contains filtered or unexported fields
}

func New

func New(
	configure func() error,
	start func() error,
	receive func(interface{}) error,
	stop func() error,
) *Runner

func (*Runner) Debugf

func (r *Runner) Debugf(format string, args ...interface{})

func (*Runner) Logf

func (r *Runner) Logf(format string, args ...interface{})

func (*Runner) OptionBool

func (r *Runner) OptionBool(name string, required bool, doc string, defaultValue bool)

func (*Runner) OptionInt

func (r *Runner) OptionInt(name string, required bool, doc string, defaultValue int)

func (*Runner) OptionIntSlice

func (r *Runner) OptionIntSlice(name string, required bool, doc string, defaultValue []int)

func (*Runner) OptionMapString

func (r *Runner) OptionMapString(name string, required bool, doc string, defaultValue map[string]string)

func (*Runner) OptionString

func (r *Runner) OptionString(name string, required bool, doc string, defaultValue string)

func (*Runner) OptionStringSlice

func (r *Runner) OptionStringSlice(name string, required bool, doc string, defaultValue []string)

func (*Runner) Run

func (t *Runner) Run(maxConcurrent int)

func (*Runner) Send

func (t *Runner) Send(data map[string]interface{}) error

Jump to

Keyboard shortcuts

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