-
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.
- Loading branch information
1 parent
07d2206
commit 4ebcb18
Showing
5 changed files
with
93 additions
and
3 deletions.
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
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,46 @@ | ||
syntax = "proto3"; | ||
|
||
package chat_v1; | ||
|
||
import "google/protobuf/timestamp.proto"; | ||
import "google/protobuf/empty.proto"; | ||
|
||
option go_package = "github.com/AndreiMartynenko/chat-server/api_config/pkg/chat_v1;chat_v1"; | ||
|
||
service ChatAPIServices { | ||
rpc Create (CreateNewChatRequest) returns (CreateNewChatResponse); | ||
rpc Delete (DeleteChatRequest) returns (DeleteChatResponse); | ||
rpc SendMessage (SendMessageRequest) returns (SendMessageResponse); | ||
} | ||
|
||
// Create NewChat Request | ||
message CreateNewChatRequest { | ||
repeated string usernames = 1; | ||
} | ||
|
||
// Create NewChat Response | ||
message CreateNewChatResponse { | ||
int64 id = 1; | ||
} | ||
|
||
// Delete Chat Request | ||
message DeleteChatRequest { | ||
int64 id = 1; | ||
} | ||
|
||
message DeleteChatResponse { | ||
google.protobuf.Empty delete_response = 1; | ||
} | ||
|
||
// SendMessage Request | ||
message SendMessageRequest { | ||
string from = 1; | ||
string text = 2; | ||
google.protobuf.Timestamp timestamp = 3; | ||
int64 chat_id = 4; | ||
} | ||
|
||
// SendMessage Response | ||
message SendMessageResponse { | ||
google.protobuf.Empty send_message_response = 1; | ||
} |
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,14 @@ | ||
package config | ||
|
||
import "github.com/joho/godotenv" | ||
|
||
//Load env file | ||
|
||
func Load(path string) error { | ||
err := godotenv.Load(path) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
} |