Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
feat: storage service
Browse files Browse the repository at this point in the history
  • Loading branch information
sysatom committed Apr 20, 2021
1 parent a921abd commit 5b333ee
Show file tree
Hide file tree
Showing 20 changed files with 713 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ configs/influxdb/
configs/*.conf
internal/app/web/templates/
*.db
upload/
318 changes: 318 additions & 0 deletions api/pb/storage.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions api/pb/storage.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
syntax = "proto3";
package pb;

import "base.proto";

option go_package = "api/pb";

service Storage {
rpc UploadFile(stream FileRequest) returns (FileReply) {}
}

message FileRequest {
oneof data {
FileInfo info = 1;
bytes chuck = 2;
}
}

message FileInfo {
string fileType = 1;
}

message FileReply {
string path = 1;
}
6 changes: 5 additions & 1 deletion cmd/message/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions cmd/storage/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package main

import (
"flag"
)

var configFile = flag.String("f", "rpc.yml", "set config file which will loading")

func main() {
flag.Parse()

a, err := CreateApp(*configFile)
if err != nil {
panic(err)
}

if err := a.Start(); err != nil {
panic(err)
}

a.AwaitSignal()
}
Loading

0 comments on commit 5b333ee

Please sign in to comment.