mirror of
https://github.com/foomo/gotsrpc.git
synced 2025-10-16 12:35:35 +00:00
80 lines
2.7 KiB
Go
80 lines
2.7 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 {
|
|
InlineStruct(ctx go_context.Context) (e InlineStruct, clientErr error)
|
|
InlineStructPtr(ctx go_context.Context) (e InlineStructPtr, clientErr error)
|
|
UnionString(ctx go_context.Context) (e UnionString, clientErr error)
|
|
UnionStruct(ctx go_context.Context) (e UnionStruct, 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) InlineStruct(ctx go_context.Context) (e InlineStruct, clientErr error) {
|
|
args := []interface{}{}
|
|
reply := []interface{}{&e}
|
|
clientErr = tsc.Client.Call(ctx, tsc.URL, tsc.EndPoint, "InlineStruct", args, reply)
|
|
if clientErr != nil {
|
|
clientErr = pkg_errors.WithMessage(clientErr, "failed to call service.ServiceGoTSRPCProxy InlineStruct")
|
|
}
|
|
return
|
|
}
|
|
|
|
func (tsc *HTTPServiceGoTSRPCClient) InlineStructPtr(ctx go_context.Context) (e InlineStructPtr, clientErr error) {
|
|
args := []interface{}{}
|
|
reply := []interface{}{&e}
|
|
clientErr = tsc.Client.Call(ctx, tsc.URL, tsc.EndPoint, "InlineStructPtr", args, reply)
|
|
if clientErr != nil {
|
|
clientErr = pkg_errors.WithMessage(clientErr, "failed to call service.ServiceGoTSRPCProxy InlineStructPtr")
|
|
}
|
|
return
|
|
}
|
|
|
|
func (tsc *HTTPServiceGoTSRPCClient) UnionString(ctx go_context.Context) (e UnionString, clientErr error) {
|
|
args := []interface{}{}
|
|
reply := []interface{}{&e}
|
|
clientErr = tsc.Client.Call(ctx, tsc.URL, tsc.EndPoint, "UnionString", args, reply)
|
|
if clientErr != nil {
|
|
clientErr = pkg_errors.WithMessage(clientErr, "failed to call service.ServiceGoTSRPCProxy UnionString")
|
|
}
|
|
return
|
|
}
|
|
|
|
func (tsc *HTTPServiceGoTSRPCClient) UnionStruct(ctx go_context.Context) (e UnionStruct, clientErr error) {
|
|
args := []interface{}{}
|
|
reply := []interface{}{&e}
|
|
clientErr = tsc.Client.Call(ctx, tsc.URL, tsc.EndPoint, "UnionStruct", args, reply)
|
|
if clientErr != nil {
|
|
clientErr = pkg_errors.WithMessage(clientErr, "failed to call service.ServiceGoTSRPCProxy UnionStruct")
|
|
}
|
|
return
|
|
}
|