pipfilter

package
v0.0.0-...-0b8e3a9 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SplitFilterWrongFormatError = errors.New("SplitFilterWrongFormatError")
View Source
var SumFilterWrongFormatError = errors.New("SumFilterWrongFormatError")
View Source
var ToIntFilterWrongFormatError = errors.New("ToIntFilterWrongFormatError")

Functions

This section is empty.

Types

type Filter

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

处理默认实现

type Request

type Request interface{}

输入(空接口别名-任意类型)

type Response

type Response interface{}

输出(空接口别名-任意类型)

type SplitFilter

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

自己组装的struct, 表示分隔符

func NewSplitFilter

func NewSplitFilter(delimiter string) *SplitFilter

func (*SplitFilter) Process

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

struct的方法扩展

type StraightPipeline

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

func NewStraightPipeline

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

func (*StraightPipeline) Process

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

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 (tif *ToIntFilter) Process(data Request) (Response, error)

Jump to

Keyboard shortcuts

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