Split etcdctl into etcdctl (public API access) & etcdutl (direct surgery on files)

Motivation is as follows:

  - etcdctl we only depend on clientv3 APIs, no dependencies of bolt, backend, mvcc, file-layout
  - etcdctl can be officially supported across wide range of versions, while etcdutl is pretty specific to file format at particular version.
it's step towards desired modules layout, documented in: https://etcd.io/docs/next/dev-internal/modules/
This commit is contained in:
Piotr Tabor
2021-05-14 13:50:31 +02:00
parent 1675101293
commit c09aca1ba4
44 changed files with 1788 additions and 963 deletions

View File

@ -20,7 +20,6 @@ import (
pb "go.etcd.io/etcd/api/v3/etcdserverpb"
spb "go.etcd.io/etcd/api/v3/mvccpb"
v3 "go.etcd.io/etcd/client/v3"
"go.etcd.io/etcd/etcdctl/v3/snapshot"
)
type fieldsPrinter struct{ printer }
@ -186,13 +185,6 @@ func (p *fieldsPrinter) Alarm(r v3.AlarmResponse) {
}
}
func (p *fieldsPrinter) DBStatus(r snapshot.Status) {
fmt.Println(`"Hash" :`, r.Hash)
fmt.Println(`"Revision" :`, r.Revision)
fmt.Println(`"Keys" :`, r.TotalKey)
fmt.Println(`"Size" :`, r.TotalSize)
}
func (p *fieldsPrinter) RoleAdd(role string, r v3.AuthRoleAddResponse) { p.hdr(r.Header) }
func (p *fieldsPrinter) RoleGet(role string, r v3.AuthRoleGetResponse) {
p.hdr(r.Header)