-
-
Notifications
You must be signed in to change notification settings - Fork 480
/
backend.go
83 lines (65 loc) · 1.67 KB
/
backend.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
73
74
75
76
77
78
79
80
81
82
83
package noop
import (
"context"
"fmt"
"github.com/gopasspw/gopass/pkg/backend"
"github.com/blang/semver"
)
// Noop is a no-op git backend
type Noop struct{}
// New creates a new Noop object
func New() *Noop {
return &Noop{}
}
// Add does nothing
func (g *Noop) Add(ctx context.Context, args ...string) error {
return nil
}
// Commit does nothing
func (g *Noop) Commit(ctx context.Context, msg string) error {
return nil
}
// Push does nothing
func (g *Noop) Push(ctx context.Context, origin, branch string) error {
return nil
}
// Pull does nothing
func (g *Noop) Pull(ctx context.Context, origin, branch string) error {
return nil
}
// Cmd does nothing
func (g *Noop) Cmd(ctx context.Context, name string, args ...string) error {
return nil
}
// Init does nothing
func (g *Noop) Init(context.Context, string, string) error {
return nil
}
// InitConfig does nothing
func (g *Noop) InitConfig(context.Context, string, string) error {
return nil
}
// Version returns an empty version
func (g *Noop) Version(context.Context) semver.Version {
return semver.Version{}
}
// Name returns noop
func (g *Noop) Name() string {
return "noop"
}
// AddRemote does nothing
func (g *Noop) AddRemote(ctx context.Context, remote, url string) error {
return nil
}
// RemoveRemote does nothing
func (g *Noop) RemoveRemote(ctx context.Context, remote string) error {
return nil
}
// Revisions is not implemented
func (g *Noop) Revisions(context.Context, string) ([]backend.Revision, error) {
return nil, fmt.Errorf("not yet implemented for %s", g.Name())
}
// GetRevision is not implemented
func (g *Noop) GetRevision(context.Context, string, string) ([]byte, error) {
return []byte(""), nil
}