SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
rename
Chris Lu3d624d1e16a8
diff --git a/weed/filer/s3iam_conf.go b/weed/filer/s3iam_conf.goindex 92387fb09b..55c9769155 100644--- a/weed/filer/s3iam_conf.go+++ b/weed/filer/s3iam_conf.go@@ -4,6 +4,7 @@ import ("bytes""github.com/chrislusf/seaweedfs/weed/pb/iam_pb""github.com/golang/protobuf/jsonpb"+ "github.com/golang/protobuf/proto""io")@@ -14,7 +15,7 @@ func ParseS3ConfigurationFromBytes(content []byte, config *iam_pb.S3ApiConfigurareturn nil}-func S3ConfigurationToText(writer io.Writer, config *iam_pb.S3ApiConfiguration) error {+func ProtoToText(writer io.Writer, config proto.Message) error {m := jsonpb.Marshaler{EmitDefaults: false,diff --git a/weed/filer/s3iam_conf_test.go b/weed/filer/s3iam_conf_test.goindex 65cc49840a..da7d9c9f13 100644--- a/weed/filer/s3iam_conf_test.go+++ b/weed/filer/s3iam_conf_test.go@@ -44,7 +44,7 @@ func TestS3Conf(t *testing.T) {},}var buf bytes.Buffer- err := S3ConfigurationToText(&buf, s3Conf)+ err := ProtoToText(&buf, s3Conf)assert.Equal(t, err, nil)s3ConfSaved := &iam_pb.S3ApiConfiguration{}err = ParseS3ConfigurationFromBytes(buf.Bytes(), s3ConfSaved)diff --git a/weed/iamapi/iamapi_server.go b/weed/iamapi/iamapi_server.goindex eb18e996d8..0375941650 100644--- a/weed/iamapi/iamapi_server.go+++ b/weed/iamapi/iamapi_server.go@@ -96,8 +96,8 @@ func (iam IamS3ApiConfigure) GetS3ApiConfiguration(s3cfg *iam_pb.S3ApiConfiguratfunc (iam IamS3ApiConfigure) PutS3ApiConfiguration(s3cfg *iam_pb.S3ApiConfiguration) (err error) {buf := bytes.Buffer{}- if err := filer.S3ConfigurationToText(&buf, s3cfg); err != nil {- return fmt.Errorf("S3ConfigurationToText: %s", err)+ if err := filer.ProtoToText(&buf, s3cfg); err != nil {+ return fmt.Errorf("ProtoToText: %s", err)}return pb.WithGrpcFilerClient(iam.option.FilerGrpcAddress,diff --git a/weed/shell/command_s3_configure.go b/weed/shell/command_s3_configure.goindex ca51ef72f2..5eab2ebd04 100644--- a/weed/shell/command_s3_configure.go+++ b/weed/shell/command_s3_configure.go@@ -164,7 +164,7 @@ func (c *commandS3Configure) Do(args []string, commandEnv *CommandEnv, writer io}buf.Reset()- filer.S3ConfigurationToText(&buf, s3cfg)+ filer.ProtoToText(&buf, s3cfg)fmt.Fprintf(writer, string(buf.Bytes()))fmt.Fprintln(writer)