custom

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MIT Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package custom implements an user defined function

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.Worker interface

type FunctionOptions

type FunctionOptions struct {
	Func UserFunction
}

FunctionOptions customize a Function Worker

func (FunctionOptions) Check added in v0.8.0

func (o FunctionOptions) Check() error

Check if a combination of options is valid

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