forked from influxdata/influxdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
servers.go
38 lines (29 loc) · 1.09 KB
/
servers.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
package mocks
import (
"context"
"github.com/influxdata/influxdb/chronograf"
)
var _ chronograf.ServersStore = &ServersStore{}
// ServersStore mock allows all functions to be set for testing
type ServersStore struct {
AllF func(context.Context) ([]chronograf.Server, error)
AddF func(context.Context, chronograf.Server) (chronograf.Server, error)
DeleteF func(context.Context, chronograf.Server) error
GetF func(ctx context.Context, ID int) (chronograf.Server, error)
UpdateF func(context.Context, chronograf.Server) error
}
func (s *ServersStore) All(ctx context.Context) ([]chronograf.Server, error) {
return s.AllF(ctx)
}
func (s *ServersStore) Add(ctx context.Context, srv chronograf.Server) (chronograf.Server, error) {
return s.AddF(ctx, srv)
}
func (s *ServersStore) Delete(ctx context.Context, srv chronograf.Server) error {
return s.DeleteF(ctx, srv)
}
func (s *ServersStore) Get(ctx context.Context, id int) (chronograf.Server, error) {
return s.GetF(ctx, id)
}
func (s *ServersStore) Update(ctx context.Context, srv chronograf.Server) error {
return s.UpdateF(ctx, srv)
}