-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake.go
40 lines (30 loc) · 1003 Bytes
/
fake.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
package script
import (
"fmt"
"golang.org/x/net/context"
"github.com/bearded-web/bearded/models/plan"
"github.com/bearded-web/bearded/models/report"
)
// fake client helps to make a mock objects if you don't want implement all methods ClientV1 interface
type FakeClient struct {
}
// Check compile time interface compatibilities
var _ ClientV1 = NewFakeClient()
func NewFakeClient() *FakeClient {
return &FakeClient{}
}
func (f *FakeClient) GetPlugin(ctx context.Context, name string) (*Plugin, error) {
return &Plugin{client: f, Name: name}, nil
}
func (f *FakeClient) RunPlugin(ctx context.Context, step *plan.WorkflowStep) (*report.Report, error) {
return nil, fmt.Errorf("No reports")
}
func (f *FakeClient) SendReport(ctx context.Context, rep *report.Report) error {
return nil
}
func (f *FakeClient) GetConfig(ctx context.Context) (*plan.Conf, error) {
return nil, nil
}
func (f *FakeClient) DownloadFile(ctx context.Context, fileId string) ([]byte, error) {
return nil, nil
}