add: generate scripts
This commit is contained in:
parent
f317b9ecb7
commit
3918c6726b
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* @Date: 2021-03-22 17:03:27
|
||||
* @LastEditors: viletyy
|
||||
* @LastEditTime: 2021-06-20 22:22:10
|
||||
* @FilePath: /potato/initialize/http_server.go
|
||||
*/
|
||||
package initialize
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/viletyy/potato/global"
|
||||
"github.com/viletyy/potato/internal/routers"
|
||||
)
|
||||
|
||||
func RunHttpServer(port string) *http.Server {
|
||||
router := routers.InitRouter()
|
||||
server := &http.Server{
|
||||
Addr: port,
|
||||
Handler: router,
|
||||
ReadTimeout: time.Duration(global.GO_CONFIG.Server.ReadTimeout) * time.Second,
|
||||
WriteTimeout: time.Duration(global.GO_CONFIG.Server.ReadTimeout) * time.Second,
|
||||
MaxHeaderBytes: 1 << 20,
|
||||
}
|
||||
|
||||
return server
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
###
|
||||
# @Date: 2021-06-20 21:43:20
|
||||
# @LastEditors: viletyy
|
||||
# @LastEditTime: 2021-06-20 22:24:50
|
||||
# @FilePath: /potato/scripts/gen_basic_proto.sh
|
||||
###
|
||||
protoc --go_out=. --go_opt=paths=source_relative \
|
||||
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
|
||||
./proto/basic/*.proto
|
|
@ -0,0 +1,9 @@
|
|||
###
|
||||
# @Date: 2021-06-20 21:43:20
|
||||
# @LastEditors: viletyy
|
||||
# @LastEditTime: 2021-06-20 22:23:27
|
||||
# @FilePath: /potato/scripts/gen_proto.sh
|
||||
###
|
||||
protoc --go_out=. --go_opt=paths=source_relative \
|
||||
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
|
||||
./proto/*.proto
|
Loading…
Reference in New Issue