reg

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2019 License: GPL-3.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

View Source
const (
	MultiplexForkName = "multiplex"
)

Variables

This section is empty.

Functions

func BoolParam

func BoolParam(params map[string]string, name string, defaultVal bool, hasDefault bool, err *error) bool

func DurationParam

func DurationParam(params map[string]string, name string, defaultVal time.Duration, hasDefault bool, err *error) time.Duration

func FloatParam

func FloatParam(params map[string]string, name string, defaultVal float64, hasDefault bool, err *error) float64

func IntParam

func IntParam(params map[string]string, name string, defaultVal int, hasDefault bool, err *error) int

func ParameterError

func ParameterError(name string, err error) error

func RegisterMultiplexFork

func RegisterMultiplexFork(builder ProcessorRegistry)

default Fork

func StrParam

func StrParam(params map[string]string, name string, defaultVal string, hasDefault bool, err *error) string

Types

type AnalysisFunc

type AnalysisFunc func(pipeline *bitflow.SamplePipeline, params map[string]string) error

type AvailableProcessor

type AvailableProcessor struct {
	Name           string
	IsFork         bool
	Description    string
	RequiredParams []string
	OptionalParams []string
}

type AvailableProcessorSlice

type AvailableProcessorSlice []AvailableProcessor

func (AvailableProcessorSlice) Len

func (slice AvailableProcessorSlice) Len() int

func (AvailableProcessorSlice) Less

func (slice AvailableProcessorSlice) Less(i, j int) bool

func (AvailableProcessorSlice) Swap

func (slice AvailableProcessorSlice) Swap(i, j int)

type ForkFunc

type ForkFunc func(subpiplines []Subpipeline, params map[string]string) (fork.Distributor, error)

type JsonProcessingStep

type JsonProcessingStep struct {
	Name           string
	IsFork         bool
	Description    string
	RequiredParams []string
	OptionalParams []string
}

type Option

type Option func(*Options)

func EnforceBatch

func EnforceBatch() Option

func OptionalParams

func OptionalParams(params ...string) Option

func RequiredParams

func RequiredParams(params ...string) Option

func SupportBatch

func SupportBatch() Option

type Options

type Options struct {
	RequiredParams []string
	OptionalParams []string

	// SupportBatchProcessing, if true this Processor can be called with batches
	SupportBatchProcessing bool

	// EnforceBatchProcessing, if true this Processor can ONLY be called with batches
	EnforceBatchProcessing bool
}

func GetOpts

func GetOpts(options []Option) Options

type ProcessingSteps

type ProcessingSteps []JsonProcessingStep

func (ProcessingSteps) Len

func (slice ProcessingSteps) Len() int

func (ProcessingSteps) Less

func (slice ProcessingSteps) Less(i, j int) bool

func (ProcessingSteps) Swap

func (slice ProcessingSteps) Swap(i, j int)

type ProcessorRegistry

type ProcessorRegistry struct {
	*ProcessorRegistryImpl
}

Avoid having to specify a pointer to a ProcessorRegistry at many locations.

func NewProcessorRegistry

func NewProcessorRegistry() ProcessorRegistry

func (ProcessorRegistry) PrintAllAnalyses

func (r ProcessorRegistry) PrintAllAnalyses() string

func (ProcessorRegistry) PrintJsonCapabilities

func (r ProcessorRegistry) PrintJsonCapabilities(out io.Writer) error

type ProcessorRegistryImpl

type ProcessorRegistryImpl struct {
	Endpoints bitflow.EndpointFactory
	// contains filtered or unexported fields
}

func (*ProcessorRegistryImpl) GetAnalysis

func (r *ProcessorRegistryImpl) GetAnalysis(name string) (analysisProcessor RegisteredAnalysis, ok bool)

func (ProcessorRegistryImpl) GetAvailableProcessors

func (r ProcessorRegistryImpl) GetAvailableProcessors() AvailableProcessorSlice

func (*ProcessorRegistryImpl) GetFork

func (r *ProcessorRegistryImpl) GetFork(name string) (fork RegisteredFork, ok bool)

func (*ProcessorRegistryImpl) RegisterAnalysis

func (r *ProcessorRegistryImpl) RegisterAnalysis(name string, setupPipeline func(pipeline *bitflow.SamplePipeline), description string, options ...Option)

func (*ProcessorRegistryImpl) RegisterAnalysisErr

func (r *ProcessorRegistryImpl) RegisterAnalysisErr(name string, setupPipeline func(pipeline *bitflow.SamplePipeline) error, description string, options ...Option)

func (*ProcessorRegistryImpl) RegisterAnalysisParams

func (r *ProcessorRegistryImpl) RegisterAnalysisParams(name string, setupPipeline func(pipeline *bitflow.SamplePipeline, params map[string]string), description string, options ...Option)

func (*ProcessorRegistryImpl) RegisterAnalysisParamsErr

func (r *ProcessorRegistryImpl) RegisterAnalysisParamsErr(name string, setupPipeline AnalysisFunc, description string, options ...Option)

func (*ProcessorRegistryImpl) RegisterFork

func (r *ProcessorRegistryImpl) RegisterFork(name string, createFork ForkFunc, description string, options ...Option)

type RegisteredAnalysis

type RegisteredAnalysis struct {
	Name                     string
	Func                     AnalysisFunc
	Description              string
	Params                   registeredParameters
	SupportsBatchProcessing  bool
	SupportsStreamProcessing bool
}

type RegisteredFork

type RegisteredFork struct {
	Name        string
	Func        ForkFunc
	Description string
	Params      registeredParameters
}

type Subpipeline

type Subpipeline interface {
	Build() (*bitflow.SamplePipeline, error)
	Keys() []string
}

Jump to

Keyboard shortcuts

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