-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathconference.go
72 lines (63 loc) · 1.89 KB
/
conference.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package main
import (
"context"
"github.com/opentracing/opentracing-go"
"github.com/uber/jaeger-lib/metrics"
"github.com/gopheracademy/manager/log"
)
type conferenceService struct {
tracer opentracing.Tracer
metricsFactory metrics.Factory
logger log.Factory
}
func newconferenceService(tracer opentracing.Tracer, metricsFactory metrics.Factory, logger log.Factory) *conferenceService {
cs := &conferenceService{
tracer: tracer,
metricsFactory: metricsFactory,
logger: logger,
}
return cs
}
func (c conferenceService) List(ctx context.Context, r ListConferenceRequest) (*ListConferenceResponse, error) {
c.logger.For(ctx).Info("conferenceService.List")
resp := &ListConferenceResponse{}
return resp, nil
}
func (c conferenceService) Create(ctx context.Context, r CreateConferenceRequest) (*CreateConferenceResponse, error) {
c.logger.For(ctx).Info("conferenceService.Create")
resp := &CreateConferenceResponse{}
return resp, nil
}
func (c conferenceService) Delete(ctx context.Context, r DeleteConferenceRequest) (*DeleteConferenceResponse, error) {
c.logger.For(ctx).Info("conferenceService.Delete")
resp := &DeleteConferenceResponse{}
return resp, nil
}
func (c conferenceService) Get(ctx context.Context, r GetConferenceRequest) (*GetConferenceResponse, error) {
c.logger.For(ctx).Info("conferenceService.Get")
resp := &GetConferenceResponse{
Conference: Conference{
Name: "Gophercon",
Events: []Event{{
Name: "GopherCon 2021",
Slug: "2021",
},
},
},
}
return resp, nil
}
func (c conferenceService) GetBySlug(ctx context.Context, r GetConferenceBySlugRequest) (*GetConferenceResponse, error) {
c.logger.For(ctx).Info("conferenceService.GetBySlug")
resp := &GetConferenceResponse{
Conference: Conference{
Name: "Gophercon",
Events: []Event{{
Name: "GopherCon 2021",
Slug: "2021",
},
},
},
}
return resp, nil
}