add Makefile
This commit is contained in:
parent
f917aff971
commit
288f880cdd
|
@ -1 +1,5 @@
|
|||
api/*.proto
|
||||
|
||||
Makefile
|
||||
|
||||
cmd/**
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
generate:
|
||||
rm -rf proto
|
||||
mkdir -p proto
|
||||
|
||||
protoc -I ./api \
|
||||
--go_out ./proto --go_opt paths=source_relative \
|
||||
--go-grpc_out ./proto --go-grpc_opt paths=source_relative \
|
||||
--grpc-gateway_out ./proto --grpc-gateway_opt paths=source_relative \
|
||||
--swagger_out=allow_merge=true,merge_file_name=main:./proto \
|
||||
./api/main.proto
|
||||
|
||||
run:
|
||||
go run ./cmd/${REPO_NAME_SNAKE}/main.go
|
|
@ -1,5 +1,17 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package crabs.${REPO_NAME};
|
||||
package crabs.${REPO_NAME_SNAKE};
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
service ${REPO_NAME_PASCAL} {
|
||||
rpc Ping(PingReq) returns (PingRsp) {
|
||||
option (google.api.http) = {
|
||||
get: "/ping"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message PingReq {}
|
||||
|
||||
message PingRsp {}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Println("Hello, World!")
|
||||
}
|
Loading…
Reference in New Issue