aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/filer_util.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/s3api/filer_util.go')
-rw-r--r--weed/s3api/filer_util.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/weed/s3api/filer_util.go b/weed/s3api/filer_util.go
index aab190ff1..c2276b89a 100644
--- a/weed/s3api/filer_util.go
+++ b/weed/s3api/filer_util.go
@@ -91,6 +91,22 @@ func (s3a *S3ApiServer) getEntry(parentDirectoryPath, entryName string) (entry *
return filer_pb.GetEntry(s3a, fullPath)
}
+func (s3a *S3ApiServer) updateEntry(parentDirectoryPath string, newEntry *filer_pb.Entry) error {
+ updateEntryRequest := &filer_pb.UpdateEntryRequest{
+ Directory: parentDirectoryPath,
+ Entry: newEntry,
+ }
+
+ err := s3a.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error {
+ err := filer_pb.UpdateEntry(client, updateEntryRequest)
+ if err != nil {
+ return err
+ }
+ return nil
+ })
+ return err
+}
+
func objectKey(key *string) *string {
if strings.HasPrefix(*key, "/") {
t := (*key)[1:]