mirror of
https://github.com/foomo/gotsrpc.git
synced 2025-10-16 12:35:35 +00:00
124 lines
4.8 KiB
Go
124 lines
4.8 KiB
Go
// Code generated by gotsrpc https://github.com/foomo/gotsrpc/v2 - DO NOT EDIT.
|
|
|
|
package service
|
|
|
|
import (
|
|
go_context "context"
|
|
go_net_http "net/http"
|
|
|
|
gotsrpc "github.com/foomo/gotsrpc/v2"
|
|
pkg_errors "github.com/pkg/errors"
|
|
)
|
|
|
|
type ServiceGoTSRPCClient interface {
|
|
VariantA(ctx go_context.Context, i1 Base) (r1 Base, clientErr error)
|
|
VariantB(ctx go_context.Context, i1 BCustomType) (r1 BCustomType, clientErr error)
|
|
VariantC(ctx go_context.Context, i1 BCustomTypes) (r1 BCustomTypes, clientErr error)
|
|
VariantD(ctx go_context.Context, i1 BCustomTypesMap) (r1 BCustomTypesMap, clientErr error)
|
|
VariantE(ctx go_context.Context, i1 *Base) (r1 *Base, clientErr error)
|
|
VariantF(ctx go_context.Context, i1 []*Base) (r1 []*Base, clientErr error)
|
|
VariantG(ctx go_context.Context, i1 map[string]*Base) (r1 map[string]*Base, clientErr error)
|
|
VariantH(ctx go_context.Context, i1 Base, i2 *Base, i3 []*Base, i4 map[string]Base) (r1 Base, r2 *Base, r3 []*Base, r4 map[string]Base, clientErr error)
|
|
}
|
|
|
|
type HTTPServiceGoTSRPCClient struct {
|
|
URL string
|
|
EndPoint string
|
|
Client gotsrpc.Client
|
|
}
|
|
|
|
func NewDefaultServiceGoTSRPCClient(url string) *HTTPServiceGoTSRPCClient {
|
|
return NewServiceGoTSRPCClient(url, "/service")
|
|
}
|
|
|
|
func NewServiceGoTSRPCClient(url string, endpoint string) *HTTPServiceGoTSRPCClient {
|
|
return NewServiceGoTSRPCClientWithClient(url, endpoint, nil)
|
|
}
|
|
|
|
func NewServiceGoTSRPCClientWithClient(url string, endpoint string, client *go_net_http.Client) *HTTPServiceGoTSRPCClient {
|
|
return &HTTPServiceGoTSRPCClient{
|
|
URL: url,
|
|
EndPoint: endpoint,
|
|
Client: gotsrpc.NewClientWithHttpClient(client),
|
|
}
|
|
}
|
|
func (tsc *HTTPServiceGoTSRPCClient) VariantA(ctx go_context.Context, i1 Base) (r1 Base, clientErr error) {
|
|
args := []interface{}{i1}
|
|
reply := []interface{}{&r1}
|
|
clientErr = tsc.Client.Call(ctx, tsc.URL, tsc.EndPoint, "VariantA", args, reply)
|
|
if clientErr != nil {
|
|
clientErr = pkg_errors.WithMessage(clientErr, "failed to call service.ServiceGoTSRPCProxy VariantA")
|
|
}
|
|
return
|
|
}
|
|
|
|
func (tsc *HTTPServiceGoTSRPCClient) VariantB(ctx go_context.Context, i1 BCustomType) (r1 BCustomType, clientErr error) {
|
|
args := []interface{}{i1}
|
|
reply := []interface{}{&r1}
|
|
clientErr = tsc.Client.Call(ctx, tsc.URL, tsc.EndPoint, "VariantB", args, reply)
|
|
if clientErr != nil {
|
|
clientErr = pkg_errors.WithMessage(clientErr, "failed to call service.ServiceGoTSRPCProxy VariantB")
|
|
}
|
|
return
|
|
}
|
|
|
|
func (tsc *HTTPServiceGoTSRPCClient) VariantC(ctx go_context.Context, i1 BCustomTypes) (r1 BCustomTypes, clientErr error) {
|
|
args := []interface{}{i1}
|
|
reply := []interface{}{&r1}
|
|
clientErr = tsc.Client.Call(ctx, tsc.URL, tsc.EndPoint, "VariantC", args, reply)
|
|
if clientErr != nil {
|
|
clientErr = pkg_errors.WithMessage(clientErr, "failed to call service.ServiceGoTSRPCProxy VariantC")
|
|
}
|
|
return
|
|
}
|
|
|
|
func (tsc *HTTPServiceGoTSRPCClient) VariantD(ctx go_context.Context, i1 BCustomTypesMap) (r1 BCustomTypesMap, clientErr error) {
|
|
args := []interface{}{i1}
|
|
reply := []interface{}{&r1}
|
|
clientErr = tsc.Client.Call(ctx, tsc.URL, tsc.EndPoint, "VariantD", args, reply)
|
|
if clientErr != nil {
|
|
clientErr = pkg_errors.WithMessage(clientErr, "failed to call service.ServiceGoTSRPCProxy VariantD")
|
|
}
|
|
return
|
|
}
|
|
|
|
func (tsc *HTTPServiceGoTSRPCClient) VariantE(ctx go_context.Context, i1 *Base) (r1 *Base, clientErr error) {
|
|
args := []interface{}{i1}
|
|
reply := []interface{}{&r1}
|
|
clientErr = tsc.Client.Call(ctx, tsc.URL, tsc.EndPoint, "VariantE", args, reply)
|
|
if clientErr != nil {
|
|
clientErr = pkg_errors.WithMessage(clientErr, "failed to call service.ServiceGoTSRPCProxy VariantE")
|
|
}
|
|
return
|
|
}
|
|
|
|
func (tsc *HTTPServiceGoTSRPCClient) VariantF(ctx go_context.Context, i1 []*Base) (r1 []*Base, clientErr error) {
|
|
args := []interface{}{i1}
|
|
reply := []interface{}{&r1}
|
|
clientErr = tsc.Client.Call(ctx, tsc.URL, tsc.EndPoint, "VariantF", args, reply)
|
|
if clientErr != nil {
|
|
clientErr = pkg_errors.WithMessage(clientErr, "failed to call service.ServiceGoTSRPCProxy VariantF")
|
|
}
|
|
return
|
|
}
|
|
|
|
func (tsc *HTTPServiceGoTSRPCClient) VariantG(ctx go_context.Context, i1 map[string]*Base) (r1 map[string]*Base, clientErr error) {
|
|
args := []interface{}{i1}
|
|
reply := []interface{}{&r1}
|
|
clientErr = tsc.Client.Call(ctx, tsc.URL, tsc.EndPoint, "VariantG", args, reply)
|
|
if clientErr != nil {
|
|
clientErr = pkg_errors.WithMessage(clientErr, "failed to call service.ServiceGoTSRPCProxy VariantG")
|
|
}
|
|
return
|
|
}
|
|
|
|
func (tsc *HTTPServiceGoTSRPCClient) VariantH(ctx go_context.Context, i1 Base, i2 *Base, i3 []*Base, i4 map[string]Base) (r1 Base, r2 *Base, r3 []*Base, r4 map[string]Base, clientErr error) {
|
|
args := []interface{}{i1, i2, i3, i4}
|
|
reply := []interface{}{&r1, &r2, &r3, &r4}
|
|
clientErr = tsc.Client.Call(ctx, tsc.URL, tsc.EndPoint, "VariantH", args, reply)
|
|
if clientErr != nil {
|
|
clientErr = pkg_errors.WithMessage(clientErr, "failed to call service.ServiceGoTSRPCProxy VariantH")
|
|
}
|
|
return
|
|
}
|