mirror of
https://gitee.com/johng/gf
synced 2026-07-06 21:45:34 +08:00
add package contrib/rpc/grpcx (#2169)
This commit is contained in:
8
example/rpc/grpcx/basic/server/config.yaml
Normal file
8
example/rpc/grpcx/basic/server/config.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
grpc:
|
||||
name: "demo"
|
||||
logPath: "./log"
|
||||
logStdout: true
|
||||
errorLogEnabled: true
|
||||
accessLogEnabled: true
|
||||
errorStack: true
|
||||
|
||||
19
example/rpc/grpcx/basic/server/main.go
Normal file
19
example/rpc/grpcx/basic/server/main.go
Normal file
@ -0,0 +1,19 @@
|
||||
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
|
||||
//
|
||||
// This Source Code Form is subject to the terms of the MIT License.
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://github.com/gogf/gf.
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/contrib/rpc/grpcx/v2"
|
||||
"github.com/gogf/gf/example/rpc/grpcx/basic/protocol"
|
||||
"github.com/gogf/gf/example/rpc/grpcx/basic/service"
|
||||
)
|
||||
|
||||
func main() {
|
||||
s := grpcx.Server.New()
|
||||
protocol.RegisterEchoServer(s.Server, new(service.Echo))
|
||||
s.Run()
|
||||
}
|
||||
Reference in New Issue
Block a user