package grpc import ( "context" "google.golang.org/grpc" "git.loafle.net/commons_go/config" cgp "git.loafle.net/commons_go/grpc_pool" oas "git.loafle.net/overflow/overflow_api_server/golang" ) type poolHandlers struct { cgp.PoolHandlers ctx context.Context cfg config.Configurator } func (h *poolHandlers) OnCreate() (*grpc.ClientConn, interface{}, error) { var err error conn, err := grpc.Dial(config.GetString("grpc.addr"), grpc.WithInsecure()) if nil != err { return nil, nil, err } c := oas.NewOverflowApiServerClient(conn) return conn, c, nil }