diff options
| author | Chris Lu <chris.lu@gmail.com> | 2018-05-08 01:59:43 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2018-05-08 01:59:43 -0700 |
| commit | 43a69d20bf724cea371da88a02bfe0b2fa02a773 (patch) | |
| tree | e0229e8ac9f35cbda0de5f5043d512522b2d23c9 /weed/pb | |
| parent | 4936d6c342e16edd9ee37d2b2ec2c890287670d4 (diff) | |
| download | seaweedfs-43a69d20bf724cea371da88a02bfe0b2fa02a773.tar.xz seaweedfs-43a69d20bf724cea371da88a02bfe0b2fa02a773.zip | |
change filer API to gRPC
Diffstat (limited to 'weed/pb')
| -rw-r--r-- | weed/pb/Makefile | 1 | ||||
| -rw-r--r-- | weed/pb/filer.proto | 85 |
2 files changed, 86 insertions, 0 deletions
diff --git a/weed/pb/Makefile b/weed/pb/Makefile index 8d0eb7854..1bb7a0b2c 100644 --- a/weed/pb/Makefile +++ b/weed/pb/Makefile @@ -4,3 +4,4 @@ all: gen gen: protoc seaweed.proto --go_out=plugins=grpc:. + protoc filer.proto --go_out=plugins=grpc:../filer diff --git a/weed/pb/filer.proto b/weed/pb/filer.proto new file mode 100644 index 000000000..a7a7f42f0 --- /dev/null +++ b/weed/pb/filer.proto @@ -0,0 +1,85 @@ +syntax = "proto3"; + +package filer; + +////////////////////////////////////////////////// + +service SeaweedFiler { + + rpc LookupDirectoryEntry (LookupDirectoryEntryRequest) returns (LookupDirectoryEntryResponse) { + } + + rpc ListEntries (ListEntriesRequest) returns (ListEntriesResponse) { + } + + rpc GetFileAttributes (GetFileAttributesRequest) returns (GetFileAttributesResponse) { + } + + rpc GetFileContent (GetFileContentRequest) returns (GetFileContentResponse) { + } + + rpc DeleteEntry (DeleteEntryRequest) returns (DeleteEntryResponse) { + } + +} + +////////////////////////////////////////////////// + +message LookupDirectoryEntryRequest { + string directory = 1; + string name = 2; +} + +message LookupDirectoryEntryResponse { + Entry entry = 1; +} + +message ListEntriesRequest { + string directory = 1; +} + +message ListEntriesResponse { + repeated Entry entries = 1; +} + +message Entry { + string name = 1; + bool is_directory = 2; + string file_id = 3; + FuseAttributes attributes = 4; +} + +message FuseAttributes { + uint64 file_size = 1; + int64 mtime = 2; + uint32 file_mode = 3; + uint32 uid = 4; + uint32 gid = 5; +} + +message GetFileAttributesRequest { + string name = 1; + string parent_dir = 2; + string file_id = 3; +} + +message GetFileAttributesResponse { + FuseAttributes attributes = 1; +} + +message GetFileContentRequest { + string file_id = 1; +} + +message GetFileContentResponse { + bytes content = 1; +} + +message DeleteEntryRequest { + string directory = 1; + string name = 2; + bool is_directory = 3; +} + +message DeleteEntryResponse { +} |
