-
-
Notifications
You must be signed in to change notification settings - Fork 171
/
trace.go
48 lines (36 loc) · 738 Bytes
/
trace.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
package core
import (
"context"
"net/http"
)
type Tracer interface {
Start(c context.Context, name string) (context.Context, Spaner)
NewHTTPClient() *http.Client
}
type Spaner interface {
SetAttributesString(attrs ...StringAttr)
IsRecording() bool
Error(err error)
End()
}
type tracer struct{}
type span struct{}
func (t *tracer) Start(c context.Context, name string) (context.Context, Spaner) {
return c, &span{}
}
func (t *tracer) NewHTTPClient() *http.Client {
return &http.Client{}
}
func (s *span) End() {
}
func (s *span) Error(err error) {
}
type StringAttr struct {
Name string
Value string
}
func (s *span) IsRecording() bool {
return false
}
func (s *span) SetAttributesString(attrs ...StringAttr) {
}