-
Notifications
You must be signed in to change notification settings - Fork 18
/
noop.go
56 lines (47 loc) · 1.24 KB
/
noop.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
package rpc
import (
"context"
"github.com/cirruslabs/cirrus-ci-agent/api"
"github.com/golang/protobuf/ptypes/empty"
"io"
)
func (r *RPC) ReportAnnotations(ctx context.Context, req *api.ReportAnnotationsCommandRequest) (*empty.Empty, error) {
return &empty.Empty{}, nil
}
func (r *RPC) SaveLogs(stream api.CirrusCIService_SaveLogsServer) error {
for {
_, err := stream.Recv()
if err == io.EOF {
break
}
if err != nil {
r.logger.Warnf("error while receiving saved logs: %v", err)
return err
}
}
if err := stream.SendAndClose(&api.UploadLogsResponse{}); err != nil {
r.logger.Warnf("error while closing saved logs stream: %v", err)
return err
}
return nil
}
func (r *RPC) UploadArtifacts(stream api.CirrusCIService_UploadArtifactsServer) error {
for {
_, err := stream.Recv()
if err == io.EOF {
break
}
if err != nil {
r.logger.Warnf("error while receiving artifacts: %v", err)
return err
}
}
if err := stream.SendAndClose(&api.UploadArtifactsResponse{}); err != nil {
r.logger.Warnf("error while closing artifacts stream: %v", err)
return err
}
return nil
}
func (r *RPC) ReportAgentLogs(ctx context.Context, req *api.ReportAgentLogsRequest) (*empty.Empty, error) {
return &empty.Empty{}, nil
}