custom

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNilFunction = errors.New("nil UserFunction passed to Worker")

ErrNilFunction a nil UserFunction is provided via FunctionOptions

Functions

This section is empty.

Types

type Function

type Function struct {
	// contains filtered or unexported fields
}

Function allow users to create custom Workers just with a function

func NewFunction

func NewFunction(opts FunctionOptions) *Function

NewFunction create a Function object with goven options

func (*Function) Process

func (f *Function) Process(ctx context.Context, args selina.ProcessArgs) error

Process implements selina.Workers

type FunctionOptions

type FunctionOptions struct {
	Func UserFunction
}

FunctionOptions customize a Function Worker

type UserFunction

type UserFunction func(input []byte) ([]byte, error)

UserFunction define an user custom modification is safe to return input to avoid allocations if an error is returned Process is aborted a filter can be implemented returning (nil,nil)

Jump to

Keyboard shortcuts

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