-
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.
Merge pull request #2 from satanaroom/task4
Task4
- Loading branch information
Showing
40 changed files
with
1,755 additions
and
301 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,5 @@ go.work | |
|
||
/bin | ||
/.idea | ||
/vendor.protogen | ||
.env |
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,44 @@ | ||
syntax = "proto3"; | ||
|
||
package chat_v1; | ||
|
||
import "validate/validate.proto"; | ||
import "google/api/annotations.proto"; | ||
import "protoc-gen-openapiv2/options/annotations.proto"; | ||
|
||
option go_package = "github.com/satanaroom/chat_server/pkg/chat_v1;chat_v1"; | ||
|
||
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { | ||
info: { | ||
title: "Chat API" | ||
version: "1.0.0" | ||
contact: { | ||
name: "Yan Karpov" | ||
email: "ftragula@mail.ru" | ||
}; | ||
}; | ||
|
||
host: "localhost:8081" | ||
schemes: HTTP | ||
schemes: HTTPS | ||
consumes: "application/json" | ||
}; | ||
|
||
service ChatV1 { | ||
rpc CreateChat(CreateChatRequest) returns (CreateChatResponse) { | ||
option (google.api.http) = { | ||
post: "/chat/v1/create" | ||
body: "*" | ||
}; | ||
}; | ||
} | ||
|
||
message CreateChatRequest { | ||
repeated string usernames = 1 [(validate.rules).repeated.max_items = 10, | ||
(validate.rules).repeated.unique = true, (validate.rules).repeated.items.string.max_len = 50]; | ||
} | ||
|
||
message CreateChatResponse { | ||
int64 chat_id = 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
Oops, something went wrong.