iaa_pipe_filter

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 6, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SplitFilterWrongFormatError = errors.New("input data should be string")
View Source
var SumFilterWrongFormatError = errors.New("input data should be []int")
View Source
var ToIntFilterWrongFormatError = errors.New("input data should be []string")

*

  • @author wjj
  • @date 2020/9/8 1:40 上午
  • @description

Functions

This section is empty.

Types

type Filter

type Filter interface {
	Process(data Request) (Response, error)
}

Filter interface is the definition of the data processing components Pipe-Filter structure

type Request

type Request interface {
}

*

  • @author wjj
  • @date 2020/9/8 1:35 上午
  • @description

Request is the input of filter

type Response

type Response interface {
}

Response is the output of filter

type SplitFilter

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

func NewSplitFilter

func NewSplitFilter(delimiter string) *SplitFilter

func (*SplitFilter) Process

func (sf *SplitFilter) Process(data Request) (Response, error)

type StraightPipeline

type StraightPipeline struct {
	Name    string
	Filters *[]Filter
}

StraightPipeline is composed of the filters, and the filters are piled as a straight line.

func NewStraightPipeline

func NewStraightPipeline(name string, filters ...Filter) *StraightPipeline

*

  • @author wjj
  • @date 2020/9/8 1:53 上午
  • @description pipeline设计模式

NewStraightPipeline create a new StraightPipelineWithWallTime

func (*StraightPipeline) Process

func (f *StraightPipeline) Process(data Request) (Response, error)

Process is to process the coming data by the pipeline

type SumFilter

type SumFilter struct {
}

func NewSumFilter

func NewSumFilter() *SumFilter

func (*SumFilter) Process

func (sf *SumFilter) Process(data Request) (Response, error)

type ToIntFilter

type ToIntFilter struct {
}

func NewToIntFilter

func NewToIntFilter() *ToIntFilter

func (*ToIntFilter) Process

func (sf *ToIntFilter) Process(data Request) (Response, error)

Jump to

Keyboard shortcuts

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