29 lines
470 B
Go
29 lines
470 B
Go
package grpc
|
|
|
|
import (
|
|
"context"
|
|
|
|
oas "git.loafle.net/overflow/overflow_api_server/golang"
|
|
)
|
|
|
|
func Exec(service string, method string, params []string) (string, error) {
|
|
c, err := _pool.Get()
|
|
if nil != err {
|
|
|
|
}
|
|
defer _pool.Put(c)
|
|
|
|
si := &oas.ServerInput{
|
|
Target: service,
|
|
Method: method,
|
|
Params: params,
|
|
}
|
|
ctx := context.Background()
|
|
so, err := c.(oas.OverflowApiServerClient).Exec(ctx, si)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
|
|
return so.Result, nil
|
|
}
|