diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-08-26 15:18:34 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-08-26 15:18:34 -0700 |
| commit | 05a648bb96df1be5a9261737d8f6fd01600c6a63 (patch) | |
| tree | 751a04da5a01ca0dd9233447b1789708bf8cba17 /weed/shell/command_remote_configure.go | |
| parent | c08ac536ed83ef2159a13ce826a249223272818f (diff) | |
| download | seaweedfs-05a648bb96df1be5a9261737d8f6fd01600c6a63.tar.xz seaweedfs-05a648bb96df1be5a9261737d8f6fd01600c6a63.zip | |
refactor: separating out remote.proto
Diffstat (limited to 'weed/shell/command_remote_configure.go')
| -rw-r--r-- | weed/shell/command_remote_configure.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/weed/shell/command_remote_configure.go b/weed/shell/command_remote_configure.go index f526cc2d7..4aaf7c034 100644 --- a/weed/shell/command_remote_configure.go +++ b/weed/shell/command_remote_configure.go @@ -6,6 +6,7 @@ import ( "fmt" "github.com/chrislusf/seaweedfs/weed/filer" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" + "github.com/chrislusf/seaweedfs/weed/pb/remote_pb" "github.com/chrislusf/seaweedfs/weed/util" "github.com/golang/protobuf/jsonpb" "github.com/golang/protobuf/proto" @@ -48,7 +49,7 @@ var ( func (c *commandRemoteConfigure) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) { - conf := &filer_pb.RemoteConf{} + conf := &remote_pb.RemoteConf{} remoteConfigureCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError) isDelete := remoteConfigureCommand.Bool("delete", false, "delete one remote storage by its name") @@ -122,7 +123,7 @@ func (c *commandRemoteConfigure) listExistingRemoteStorages(commandEnv *CommandE if !strings.HasSuffix(entry.Name, filer.REMOTE_STORAGE_CONF_SUFFIX) { return nil } - conf := &filer_pb.RemoteConf{} + conf := &remote_pb.RemoteConf{} if err := proto.Unmarshal(entry.Content, conf); err != nil { return fmt.Errorf("unmarshal %s/%s: %v", filer.DirectoryEtcRemote, entry.Name, err) @@ -168,7 +169,7 @@ func (c *commandRemoteConfigure) deleteRemoteStorage(commandEnv *CommandEnv, wri } -func (c *commandRemoteConfigure) saveRemoteStorage(commandEnv *CommandEnv, writer io.Writer, conf *filer_pb.RemoteConf) error { +func (c *commandRemoteConfigure) saveRemoteStorage(commandEnv *CommandEnv, writer io.Writer, conf *remote_pb.RemoteConf) error { data, err := proto.Marshal(conf) if err != nil { |
