Files
gout/dataflow/filter_interface.go
guonaihong 96c22a2b9c 新增request中间件设计 (#236)
* 扩展gout设计,概念上新增request中间件

* 新增RequestUse传入请求中间件
2020-06-23 15:12:56 +08:00

46 lines
747 B
Go

package dataflow
import (
"github.com/guonaihong/gout/bench"
"io"
"time"
)
type NewFilter interface {
New(*DataFlow) interface{}
}
type Bencher interface {
Concurrent(c int) Bencher
Number(n int) Bencher
Rate(rate int) Bencher
Durations(d time.Duration) Bencher
Loop(func(c *Context) error) Bencher
GetReport(r *bench.Report) Bencher
Do() error
}
type Retry interface {
Attempt(attempt int) Retry
WaitTime(waitTime time.Duration) Retry
MaxWaitTime(maxWaitTime time.Duration) Retry
Func(func(c *Context) error) Retry
Do() error
}
type Filter interface {
Bench() Bencher
Retry() Retry
}
type Curl interface {
LongOption() Curl
GenAndSend() Curl
SetOutput(w io.Writer) Curl
Do() error
}
type Export interface {
Curl()
}