Skip to content

👏A generic and eas-to-use grpc client based on grpcurl. 一个通用且易用的grpc客户端

Notifications You must be signed in to change notification settings

larkwins/grpcli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grpcli

A generic grpc client based on grpcurl.

Prerequisites:

  1. Start a GRPC server and enable reflection like below:
import "google.golang.org/grpc/reflection"

func main(){
    server := grpc.NewServer()    
    reflection.Register(server)
    // start server listening    
}

Usage:

import "github.com/gogoods/grpcli"

func main(){
    cli := grpcli.NewClient()
    
    reply, cost, err := cli.Invoke(context.Background(),
    		"10.40.212.34:40004",
    		"Account",
    		"DescUserInfo",
    		`{"UserID":1532}`,
    	)
}

or see: client_test.go

About

👏A generic and eas-to-use grpc client based on grpcurl. 一个通用且易用的grpc客户端

Resources

Stars

Watchers

Forks

Packages

No packages published