From 8e734e479f96ca9cf19b161e1a56efbee53db72c Mon Sep 17 00:00:00 2001 From: r2 Date: Wed, 25 May 2022 13:28:42 +0800 Subject: [PATCH] fix: fetch @PichuChen 's patch to let project built easier ref: https://github.com/ptt/pttweb/pull/18 --- README.md | 11 +++++++++++ go.mod | 7 ++++--- go.sum | 11 +++++++++++ proto/Makefile | 4 ++++ proto/api/Makefile | 6 +++++- proto/api/board.proto | 2 ++ proto/man/Makefile | 5 ++++- proto/man/man.proto | 2 ++ 8 files changed, 43 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ace0145..21d5468 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,17 @@ Features - Templating support - Ask user if he/she is over age 18 when entering some areas. +Build +----- + +Install [grpc](https://grpc.io/docs/languages/go/quickstart/) + + $ cd proto + $ make + $ ../ + $ go build + + Configuration ------------- diff --git a/go.mod b/go.mod index c7f4b79..068ad83 100644 --- a/go.mod +++ b/go.mod @@ -5,13 +5,14 @@ go 1.15 require ( github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b github.com/go-redis/redis v6.15.9+incompatible - github.com/golang/protobuf v1.4.2 + github.com/golang/protobuf v1.5.2 github.com/gorilla/mux v1.8.0 github.com/onsi/ginkgo v1.14.1 // indirect github.com/onsi/gomega v1.10.2 // indirect github.com/rvelhote/go-recaptcha v0.0.0-20170215232712-e143c6ea64e5 golang.org/x/net v0.0.0-20200904194848-62affa334b73 golang.org/x/tools v0.0.0-20200904185747-39188db58858 - google.golang.org/grpc v1.31.1 - google.golang.org/protobuf v1.23.0 + google.golang.org/grpc v1.32.0 + google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 // indirect + google.golang.org/protobuf v1.26.0 ) diff --git a/go.sum b/go.sum index 9dd6219..2c94304 100644 --- a/go.sum +++ b/go.sum @@ -26,11 +26,15 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -110,6 +114,10 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.31.1 h1:SfXqXS5hkufcdZ/mHtYCh53P2b+92WQq/DZcKLgsFRs= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= +google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 h1:M1YKkFIboKNieVO5DLUEVzQfGwJD30Nv2jfUgzb5UcE= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -117,6 +125,9 @@ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miE google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= diff --git a/proto/Makefile b/proto/Makefile index d9355e6..fea6057 100644 --- a/proto/Makefile +++ b/proto/Makefile @@ -3,3 +3,7 @@ all: make -C man make -C api + +clean: + make clean -C man + make clean -C api diff --git a/proto/api/Makefile b/proto/api/Makefile index 8f8cbaa..33d8bfc 100644 --- a/proto/api/Makefile +++ b/proto/api/Makefile @@ -1,4 +1,8 @@ .PHONY: all all: - protoc --go_out=plugins=grpc:. *.proto + protoc --go_out=. --go-grpc_out=. *.proto + +clean: + rm board.pb.go board_grpc.pb.go + diff --git a/proto/api/board.proto b/proto/api/board.proto index c57ee21..3f7aa2a 100644 --- a/proto/api/board.proto +++ b/proto/api/board.proto @@ -5,6 +5,8 @@ syntax = "proto3"; // // The MIT License. +option go_package = "./;api"; + package pttbbs.api; service BoardService { diff --git a/proto/man/Makefile b/proto/man/Makefile index 8f8cbaa..9661e5e 100644 --- a/proto/man/Makefile +++ b/proto/man/Makefile @@ -1,4 +1,7 @@ .PHONY: all all: - protoc --go_out=plugins=grpc:. *.proto + protoc --go_out=. --go-grpc_out=. *.proto + +clean: + rm man.pb.go man_grpc.pb.go diff --git a/proto/man/man.proto b/proto/man/man.proto index 2748388..00e76d7 100644 --- a/proto/man/man.proto +++ b/proto/man/man.proto @@ -5,6 +5,8 @@ syntax = "proto3"; // // The MIT License. +option go_package = "./;gen"; + package pttbbs.man; service ManService {