server

package
v2.14.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceGoTSRPCProxyCustomError  = "CustomError"
	ServiceGoTSRPCProxyError        = "Error"
	ServiceGoTSRPCProxyHello        = "Hello"
	ServiceGoTSRPCProxyJoinedError  = "JoinedError"
	ServiceGoTSRPCProxyPkgError     = "PkgError"
	ServiceGoTSRPCProxyWrappedError = "WrappedError"
)

Variables

View Source
var (
	ErrGo  = pkgerrors.New("go")
	ErrPkg = pkgerrors.New("pkg error")
)

Functions

func NewMyError

func NewMyError(msg string) error

Types

type HTTPServiceGoTSRPCClient

type HTTPServiceGoTSRPCClient struct {
	URL      string
	EndPoint string
	Client   gotsrpc.Client
}

func NewDefaultServiceGoTSRPCClient

func NewDefaultServiceGoTSRPCClient(url string) *HTTPServiceGoTSRPCClient

func NewServiceGoTSRPCClient

func NewServiceGoTSRPCClient(url string, endpoint string) *HTTPServiceGoTSRPCClient

func NewServiceGoTSRPCClientWithClient

func NewServiceGoTSRPCClientWithClient(url string, endpoint string, client *go_net_http.Client) *HTTPServiceGoTSRPCClient

func (*HTTPServiceGoTSRPCClient) CustomError

func (tsc *HTTPServiceGoTSRPCClient) CustomError(ctx go_context.Context, msg string) (retCustomError_0 error, clientErr error)

func (*HTTPServiceGoTSRPCClient) Error

func (tsc *HTTPServiceGoTSRPCClient) Error(ctx go_context.Context, msg string) (retError_0 error, clientErr error)

func (*HTTPServiceGoTSRPCClient) Hello

func (tsc *HTTPServiceGoTSRPCClient) Hello(ctx go_context.Context, msg string) (retHello_0 string, clientErr error)

func (*HTTPServiceGoTSRPCClient) JoinedError

func (tsc *HTTPServiceGoTSRPCClient) JoinedError(ctx go_context.Context, msg string) (retJoinedError_0 error, clientErr error)

func (*HTTPServiceGoTSRPCClient) PkgError

func (tsc *HTTPServiceGoTSRPCClient) PkgError(ctx go_context.Context, msg string) (retPkgError_0 error, clientErr error)

func (*HTTPServiceGoTSRPCClient) WrappedError

func (tsc *HTTPServiceGoTSRPCClient) WrappedError(ctx go_context.Context, msg string) (retWrappedError_0 error, clientErr error)

type Handler

type Handler struct{}

func (*Handler) CustomError

func (h *Handler) CustomError(ctx context.Context, msg string) error

func (*Handler) Error

func (h *Handler) Error(ctx context.Context, args string) error

func (*Handler) Hello

func (h *Handler) Hello(ctx context.Context, args string) string

func (*Handler) JoinedError

func (h *Handler) JoinedError(ctx context.Context, args string) error

func (*Handler) PkgError

func (h *Handler) PkgError(ctx context.Context, args string) error

func (*Handler) WrappedError

func (h *Handler) WrappedError(ctx context.Context, args string) error

type MyError

type MyError struct {
	Payload string `json:"payload"`
}

func (*MyError) Error

func (e *MyError) Error() string

type Service

type Service interface {
	Hello(ctx context.Context, msg string) string
	Error(ctx context.Context, msg string) error
	PkgError(ctx context.Context, msg string) error
	JoinedError(ctx context.Context, msg string) error
	WrappedError(ctx context.Context, msg string) error
	CustomError(ctx context.Context, msg string) error
}

type ServiceCustomErrorRequest

type ServiceCustomErrorRequest struct {
	Msg string
}

type ServiceCustomErrorResponse

type ServiceCustomErrorResponse struct {
	RetCustomError_0 error
}

type ServiceErrorRequest

type ServiceErrorRequest struct {
	Msg string
}

type ServiceErrorResponse

type ServiceErrorResponse struct {
	RetError_0 error
}

type ServiceGoRPCClient

type ServiceGoRPCClient struct {
	Client *gorpc.Client
}

func NewServiceGoRPCClient

func NewServiceGoRPCClient(addr string, tlsConfig *tls.Config) *ServiceGoRPCClient

func (*ServiceGoRPCClient) CustomError

func (tsc *ServiceGoRPCClient) CustomError(msg string) (retCustomError_0 error, clientErr error)

func (*ServiceGoRPCClient) Error

func (tsc *ServiceGoRPCClient) Error(msg string) (retError_0 error, clientErr error)

func (*ServiceGoRPCClient) Hello

func (tsc *ServiceGoRPCClient) Hello(msg string) (retHello_0 string, clientErr error)

func (*ServiceGoRPCClient) JoinedError

func (tsc *ServiceGoRPCClient) JoinedError(msg string) (retJoinedError_0 error, clientErr error)

func (*ServiceGoRPCClient) PkgError

func (tsc *ServiceGoRPCClient) PkgError(msg string) (retPkgError_0 error, clientErr error)

func (*ServiceGoRPCClient) Start

func (tsc *ServiceGoRPCClient) Start()

func (*ServiceGoRPCClient) Stop

func (tsc *ServiceGoRPCClient) Stop()

func (*ServiceGoRPCClient) WrappedError

func (tsc *ServiceGoRPCClient) WrappedError(msg string) (retWrappedError_0 error, clientErr error)

type ServiceGoRPCProxy

type ServiceGoRPCProxy struct {
	// contains filtered or unexported fields
}

func NewServiceGoRPCProxy

func NewServiceGoRPCProxy(addr string, service Service, tlsConfig *tls.Config) *ServiceGoRPCProxy

func (*ServiceGoRPCProxy) Serve

func (p *ServiceGoRPCProxy) Serve() error

func (*ServiceGoRPCProxy) SetCallStatsHandler

func (p *ServiceGoRPCProxy) SetCallStatsHandler(handler gotsrpc.GoRPCCallStatsHandlerFun)

func (*ServiceGoRPCProxy) Start

func (p *ServiceGoRPCProxy) Start() error

func (*ServiceGoRPCProxy) Stop

func (p *ServiceGoRPCProxy) Stop()

type ServiceGoTSRPCClient

type ServiceGoTSRPCClient interface {
	CustomError(ctx go_context.Context, msg string) (retCustomError_0 error, clientErr error)
	Error(ctx go_context.Context, msg string) (retError_0 error, clientErr error)
	Hello(ctx go_context.Context, msg string) (retHello_0 string, clientErr error)
	JoinedError(ctx go_context.Context, msg string) (retJoinedError_0 error, clientErr error)
	PkgError(ctx go_context.Context, msg string) (retPkgError_0 error, clientErr error)
	WrappedError(ctx go_context.Context, msg string) (retWrappedError_0 error, clientErr error)
}

type ServiceGoTSRPCProxy

type ServiceGoTSRPCProxy struct {
	EndPoint string
	// contains filtered or unexported fields
}

func NewDefaultServiceGoTSRPCProxy

func NewDefaultServiceGoTSRPCProxy(service Service) *ServiceGoTSRPCProxy

func NewServiceGoTSRPCProxy

func NewServiceGoTSRPCProxy(service Service, endpoint string) *ServiceGoTSRPCProxy

func (*ServiceGoTSRPCProxy) ServeHTTP

func (p *ServiceGoTSRPCProxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP exposes your service

type ServiceHelloRequest

type ServiceHelloRequest struct {
	Msg string
}

type ServiceHelloResponse

type ServiceHelloResponse struct {
	RetHello_0 string
}

type ServiceJoinedErrorRequest

type ServiceJoinedErrorRequest struct {
	Msg string
}

type ServiceJoinedErrorResponse

type ServiceJoinedErrorResponse struct {
	RetJoinedError_0 error
}

type ServicePkgErrorRequest

type ServicePkgErrorRequest struct {
	Msg string
}

type ServicePkgErrorResponse

type ServicePkgErrorResponse struct {
	RetPkgError_0 error
}

type ServiceWrappedErrorRequest

type ServiceWrappedErrorRequest struct {
	Msg string
}

type ServiceWrappedErrorResponse

type ServiceWrappedErrorResponse struct {
	RetWrappedError_0 error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL