deprecated_overflow_gateway.../grpc/client.go
2017-09-11 11:24:18 +09:00

31 lines
489 B
Go

package grpc
import (
"context"
"strings"
oas "git.loafle.net/overflow/overflow_api_server/golang"
)
func Exec(ctx context.Context, method string, params []string) (string, error) {
c, err := _pool.Get()
if nil != err {
}
defer _pool.Put(c)
sm := strings.Split(method, ".")
si := &oas.ServerInput{
Target: sm[0],
Method: sm[1],
Params: params,
}
so, err := c.(oas.OverflowApiServerClient).Exec(ctx, si)
if err != nil {
return "", err
}
return so.Result, nil
}