-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathinterfaces.go
50 lines (40 loc) · 971 Bytes
/
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
package templar
import (
"github.com/amir/raidman"
"io"
"net/http"
"time"
)
type Responder interface {
Send(resp *http.Response) io.Writer
}
type Client interface {
Forward(res Responder, req *http.Request) error
}
type Stats interface {
StartRequest(req *http.Request)
Emit(req *http.Request, dur time.Duration)
RequestTimeout(req *http.Request, timeout time.Duration)
}
type Transport interface {
RoundTrip(*http.Request) (*http.Response, error)
CancelRequest(req *http.Request)
}
type Fallback interface {
Fallback(*http.Request) (*http.Response, error)
}
type CacheBackend interface {
Set(req *http.Request, resp *http.Response)
Get(req *http.Request) (*http.Response, bool)
}
type Finisher interface {
Finish()
}
type StatsdClient interface {
Incr(name string, count int64) error
GaugeDelta(name string, delta int64) error
PrecisionTiming(name string, t time.Duration) error
}
type RiemannClient interface {
Send(*raidman.Event) error
}