This repository has been archived by the owner on Dec 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): add file server definition
- Loading branch information
Showing
4 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package daemons | ||
|
||
import ( | ||
"context" | ||
|
||
"google.golang.org/grpc/codes" | ||
"google.golang.org/grpc/status" | ||
|
||
fsv1 "github.com/mjpitz/aetherfs/api/aetherfs/fs/v1" | ||
) | ||
|
||
type fileServerService struct { | ||
fsv1.UnsafeFileServerAPIServer | ||
} | ||
|
||
func (f *fileServerService) Lookup(ctx context.Context, request *fsv1.LookupRequest) (*fsv1.LookupResponse, error) { | ||
// parse path | ||
request.GetPath() | ||
|
||
return nil, status.Errorf(codes.Unimplemented, "unimplemented") | ||
} | ||
|
||
var _ fsv1.FileServerAPIServer = &fileServerService{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright (C) The AetherFS Authors - All Rights Reserved | ||
// | ||
// Proprietary and confidential. | ||
// Unauthorized copying of this file, via any medium is strictly prohibited. | ||
// Written by Mya Pitzeruse, September 2021 | ||
|
||
syntax = "proto3"; | ||
|
||
package aetherfs.fs.v1; | ||
|
||
import "google/api/annotations.proto"; | ||
|
||
option csharp_namespace = "AetherFS.FS.V1"; | ||
option go_package = "github.com/mjpitz/aetherfs/api/aetherfs/fs/v1;fsv1"; | ||
option java_package = "tech.aetherfs.fs.v1"; | ||
option java_outer_classname = "APIProto"; | ||
option java_generate_equals_and_hash = true; | ||
option java_multiple_files = true; | ||
|
||
message StringList { | ||
repeated string values = 1; | ||
} | ||
|
||
message LookupRequest { | ||
string path = 1; | ||
} | ||
|
||
message LookupResponse { | ||
string body = 1; | ||
} | ||
|
||
service FileServerAPI { | ||
rpc Lookup(LookupRequest) returns (LookupResponse) { | ||
option (google.api.http) = { | ||
get: "/v1/fs/{path=**}" | ||
response_body: "body" | ||
}; | ||
} | ||
} |