grpc/

directory
v0.0.0-...-5870b03 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2023 License: GPL-3.0

Directories

Path Synopsis
balancer
p2c
支持连接https+grpc共享端口的版本,也支持非证书版 Usage: conn, err := client.NewClientConn("localhost:63333", "server.crt", "server.grpc.io", grpc.WithPerRPCCredentials(&rpc.X{Value: "abc", Key: "x"})) client := rpc.NewHelloServiceClient(conn)
支持连接https+grpc共享端口的版本,也支持非证书版 Usage: conn, err := client.NewClientConn("localhost:63333", "server.crt", "server.grpc.io", grpc.WithPerRPCCredentials(&rpc.X{Value: "abc", Key: "x"})) client := rpc.NewHelloServiceClient(conn)
register
// register service cr := register.NewConsulRegister(fmt.Sprintf("%s:%d", host, consul_port), 15)
// register service cr := register.NewConsulRegister(fmt.Sprintf("%s:%d", host, consul_port), 15)
支持https+grpc的共享端口版,不需要ca证书 获取http+grpc,两个服务必须独立端口 Usage: 如果是grpc+https s, err := server.NewServer(hfw.Config.Server, opt...) RegisterHelloServiceServer(s, &HelloServiceImpl{auth: auth.NewAuthWithHTTPS("value")}) 如果是http+grpc s, err := server.NewServer(hfw.Config.Server, opt...) RegisterHelloServiceServer(s, &HelloServiceImpl{auth: auth.NewAuth("value")}) go server.StartServer(s, ":1234")
支持https+grpc的共享端口版,不需要ca证书 获取http+grpc,两个服务必须独立端口 Usage: 如果是grpc+https s, err := server.NewServer(hfw.Config.Server, opt...) RegisterHelloServiceServer(s, &HelloServiceImpl{auth: auth.NewAuthWithHTTPS("value")}) 如果是http+grpc s, err := server.NewServer(hfw.Config.Server, opt...) RegisterHelloServiceServer(s, &HelloServiceImpl{auth: auth.NewAuth("value")}) go server.StartServer(s, ":1234")

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL