-
-
Notifications
You must be signed in to change notification settings - Fork 480
/
loader.go
38 lines (29 loc) · 828 Bytes
/
loader.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 cli
import (
"context"
"github.com/gopasspw/gopass/pkg/backend"
gpgcli "github.com/gopasspw/gopass/pkg/backend/crypto/gpg/cli"
)
const (
name = "gitcli"
)
func init() {
backend.RegisterRCS(backend.GitCLI, name, &loader{})
}
type loader struct{}
// Open implements backend.RCSLoader
func (l loader) Open(ctx context.Context, path string) (backend.RCS, error) {
gpgBin, _ := gpgcli.Binary(ctx, "")
return Open(path, gpgBin)
}
// Clone implements backend.RCSLoader
func (l loader) Clone(ctx context.Context, repo, path string) (backend.RCS, error) {
return Clone(ctx, repo, path)
}
// Init implements backend.RCSLoader
func (l loader) Init(ctx context.Context, path, username, email string) (backend.RCS, error) {
return Init(ctx, path, username, email)
}
func (l loader) String() string {
return name
}