-
Notifications
You must be signed in to change notification settings - Fork 3
/
interfaces.go
52 lines (42 loc) · 1.12 KB
/
interfaces.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package main
import "github.com/valyala/fasthttp"
// Emitter produce requests, they should be high efficient,
// since called after every completed request and periodically
type Emitter interface {
emitRequests(state *OPState)
}
//URLFormatter alters user supplied url string
type URLFormatter interface {
format(requestNum int64) string
}
//HTTPAuther alters http requests with authentication headers
type HTTPAuther interface {
sign(r *fasthttp.Request)
}
//Adjuster should decide whether change throughput based on response
type Adjuster interface {
adjust(response *Response)
}
//Requester does actual requests to server/fs
type Requester interface {
request(channel chan *Response, request *Request)
}
//Target supplies requester with num of file/template
type Target interface {
get() string
}
//Output presents result in human or variable machine readable forms
type Output interface {
progress(s string)
reportError(s string)
report(s string)
printResults(result *Results)
}
type S3Auther interface {
sign(r *fasthttp.Request)
}
type PayloadGetter interface {
Get() []byte
GetFull() []byte
GetLength() int64
}