Documentation
¶
Index ¶
- Constants
- Variables
- type ErrService
- type HTTPServiceGoTSRPCClient
- func (tsc *HTTPServiceGoTSRPCClient) CustomError(ctx go_context.Context) (e error, clientErr error)
- func (tsc *HTTPServiceGoTSRPCClient) Error(ctx go_context.Context) (e error, clientErr error)
- func (tsc *HTTPServiceGoTSRPCClient) Errors(ctx go_context.Context) (e1 error, e2 error, clientErr error)
- func (tsc *HTTPServiceGoTSRPCClient) MultiScalar(ctx go_context.Context) (e *MultiScalar, clientErr error)
- func (tsc *HTTPServiceGoTSRPCClient) Scalar(ctx go_context.Context) (e *ScalarError, clientErr error)
- func (tsc *HTTPServiceGoTSRPCClient) ScalarError(ctx go_context.Context) (e error, clientErr error)
- func (tsc *HTTPServiceGoTSRPCClient) Struct(ctx go_context.Context) (e *StructError, clientErr error)
- func (tsc *HTTPServiceGoTSRPCClient) StructError(ctx go_context.Context) (e error, clientErr error)
- func (tsc *HTTPServiceGoTSRPCClient) TypedCustomError(ctx go_context.Context) (e error, clientErr error)
- func (tsc *HTTPServiceGoTSRPCClient) TypedError(ctx go_context.Context) (e error, clientErr error)
- func (tsc *HTTPServiceGoTSRPCClient) TypedScalarError(ctx go_context.Context) (e error, clientErr error)
- func (tsc *HTTPServiceGoTSRPCClient) TypedWrappedError(ctx go_context.Context) (e error, clientErr error)
- func (tsc *HTTPServiceGoTSRPCClient) WrappedError(ctx go_context.Context) (e error, clientErr error)
- type Handler
- func (h *Handler) CustomError(w http.ResponseWriter, r *http.Request) (e error)
- func (h *Handler) Error(w http.ResponseWriter, r *http.Request) (e error)
- func (h *Handler) Errors(w http.ResponseWriter, r *http.Request) (e1 error, e2 error)
- func (h *Handler) MultiScalar(w http.ResponseWriter, r *http.Request) (e *MultiScalar)
- func (h *Handler) Scalar(w http.ResponseWriter, r *http.Request) (e *ScalarError)
- func (h *Handler) ScalarError(w http.ResponseWriter, r *http.Request) (e error)
- func (h *Handler) Struct(w http.ResponseWriter, r *http.Request) (e *StructError)
- func (h *Handler) StructError(w http.ResponseWriter, r *http.Request) (e error)
- func (h *Handler) TypedCustomError(w http.ResponseWriter, r *http.Request) (e error)
- func (h *Handler) TypedError(w http.ResponseWriter, r *http.Request) (e error)
- func (h *Handler) TypedScalarError(w http.ResponseWriter, r *http.Request) (e error)
- func (h *Handler) TypedWrappedError(w http.ResponseWriter, r *http.Request) (e error)
- func (h *Handler) WrappedError(w http.ResponseWriter, r *http.Request) (e error)
- type MultiScalar
- type MyCustomError
- type MyScalarError
- type MyStructError
- type ScalarA
- type ScalarB
- type ScalarError
- type Service
- type ServiceGoTSRPCClient
- type ServiceGoTSRPCProxy
- type StructError
Constants ¶
View Source
const ( ServiceGoTSRPCProxyCustomError = "CustomError" ServiceGoTSRPCProxyError = "Error" ServiceGoTSRPCProxyErrors = "Errors" ServiceGoTSRPCProxyMultiScalar = "MultiScalar" ServiceGoTSRPCProxyScalar = "Scalar" ServiceGoTSRPCProxyScalarError = "ScalarError" ServiceGoTSRPCProxyStruct = "Struct" ServiceGoTSRPCProxyStructError = "StructError" ServiceGoTSRPCProxyTypedCustomError = "TypedCustomError" ServiceGoTSRPCProxyTypedError = "TypedError" ServiceGoTSRPCProxyTypedScalarError = "TypedScalarError" ServiceGoTSRPCProxyTypedWrappedError = "TypedWrappedError" ServiceGoTSRPCProxyWrappedError = "WrappedError" )
View Source
const ( ScalarOne ScalarError = "one" ScalarTwo ScalarError = "two" ScalarAOne ScalarA = "one" ScalarATwo ScalarA = "two" ScalarBThree ScalarB = "three" ScalarBFour ScalarB = "four" )
Variables ¶
View Source
var ( ErrTyped = errors.New("typed error") ErrCustom = NewMyCustomError("typed custom error") ErrScalarOne = NewMyScalarError(MyScalarErrorOne) ErrScalarTwo = NewMyScalarError(MyScalarErrorTwo) )
Functions ¶
This section is empty.
Types ¶
type HTTPServiceGoTSRPCClient ¶
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) (e error, clientErr error)
func (*HTTPServiceGoTSRPCClient) Error ¶
func (tsc *HTTPServiceGoTSRPCClient) Error(ctx go_context.Context) (e error, clientErr error)
func (*HTTPServiceGoTSRPCClient) Errors ¶
func (tsc *HTTPServiceGoTSRPCClient) Errors(ctx go_context.Context) (e1 error, e2 error, clientErr error)
func (*HTTPServiceGoTSRPCClient) MultiScalar ¶
func (tsc *HTTPServiceGoTSRPCClient) MultiScalar(ctx go_context.Context) (e *MultiScalar, clientErr error)
func (*HTTPServiceGoTSRPCClient) Scalar ¶
func (tsc *HTTPServiceGoTSRPCClient) Scalar(ctx go_context.Context) (e *ScalarError, clientErr error)
func (*HTTPServiceGoTSRPCClient) ScalarError ¶
func (tsc *HTTPServiceGoTSRPCClient) ScalarError(ctx go_context.Context) (e error, clientErr error)
func (*HTTPServiceGoTSRPCClient) Struct ¶
func (tsc *HTTPServiceGoTSRPCClient) Struct(ctx go_context.Context) (e *StructError, clientErr error)
func (*HTTPServiceGoTSRPCClient) StructError ¶
func (tsc *HTTPServiceGoTSRPCClient) StructError(ctx go_context.Context) (e error, clientErr error)
func (*HTTPServiceGoTSRPCClient) TypedCustomError ¶
func (tsc *HTTPServiceGoTSRPCClient) TypedCustomError(ctx go_context.Context) (e error, clientErr error)
func (*HTTPServiceGoTSRPCClient) TypedError ¶
func (tsc *HTTPServiceGoTSRPCClient) TypedError(ctx go_context.Context) (e error, clientErr error)
func (*HTTPServiceGoTSRPCClient) TypedScalarError ¶
func (tsc *HTTPServiceGoTSRPCClient) TypedScalarError(ctx go_context.Context) (e error, clientErr error)
func (*HTTPServiceGoTSRPCClient) TypedWrappedError ¶
func (tsc *HTTPServiceGoTSRPCClient) TypedWrappedError(ctx go_context.Context) (e error, clientErr error)
func (*HTTPServiceGoTSRPCClient) WrappedError ¶
func (tsc *HTTPServiceGoTSRPCClient) WrappedError(ctx go_context.Context) (e error, clientErr error)
type Handler ¶
type Handler struct{}
func (*Handler) CustomError ¶
func (*Handler) MultiScalar ¶
func (h *Handler) MultiScalar(w http.ResponseWriter, r *http.Request) (e *MultiScalar)
func (*Handler) Scalar ¶
func (h *Handler) Scalar(w http.ResponseWriter, r *http.Request) (e *ScalarError)
func (*Handler) ScalarError ¶
func (*Handler) Struct ¶
func (h *Handler) Struct(w http.ResponseWriter, r *http.Request) (e *StructError)
func (*Handler) StructError ¶
func (*Handler) TypedCustomError ¶
func (*Handler) TypedError ¶
func (*Handler) TypedScalarError ¶
func (*Handler) TypedWrappedError ¶
func (*Handler) WrappedError ¶
type MultiScalar ¶
type MyCustomError ¶
type MyCustomError struct {
Msg string
Map map[string]string
Slice []string
Struct struct {
A string
}
}
func NewMyCustomError ¶
func NewMyCustomError(msg string) *MyCustomError
func (*MyCustomError) Error ¶
func (e *MyCustomError) Error() string
type MyScalarError ¶
type MyScalarError string
const ( MyScalarErrorOne MyScalarError = "scalar error one" MyScalarErrorTwo MyScalarError = "scalar error two" )
func NewMyScalarError ¶
func NewMyScalarError(e MyScalarError) *MyScalarError
func (*MyScalarError) Error ¶
func (e *MyScalarError) Error() string
type MyStructError ¶
type MyStructError struct {
Msg string
Map map[string]string
Slice []string
Struct struct {
A string
}
}
func NewMyStructError ¶
func NewMyStructError(msg string) MyStructError
func (MyStructError) Error ¶
func (e MyStructError) Error() string
type ScalarError ¶
type ScalarError string
func (*ScalarError) Error ¶
func (s *ScalarError) Error() string
func (*ScalarError) String ¶
func (s *ScalarError) String() string
type Service ¶
type Service interface {
Error(w http.ResponseWriter, r *http.Request) (e error)
Errors(w http.ResponseWriter, r *http.Request) (e1 error, e2 error)
Scalar(w http.ResponseWriter, r *http.Request) (e *ScalarError)
MultiScalar(w http.ResponseWriter, r *http.Request) (e *MultiScalar)
Struct(w http.ResponseWriter, r *http.Request) (e *StructError)
StructError(w http.ResponseWriter, r *http.Request) (e error)
TypedError(w http.ResponseWriter, r *http.Request) (e error)
ScalarError(w http.ResponseWriter, r *http.Request) (e error)
CustomError(w http.ResponseWriter, r *http.Request) (e error)
WrappedError(w http.ResponseWriter, r *http.Request) (e error)
TypedWrappedError(w http.ResponseWriter, r *http.Request) (e error)
TypedScalarError(w http.ResponseWriter, r *http.Request) (e error)
TypedCustomError(w http.ResponseWriter, r *http.Request) (e error)
}
type ServiceGoTSRPCClient ¶
type ServiceGoTSRPCClient interface {
CustomError(ctx go_context.Context) (e error, clientErr error)
Error(ctx go_context.Context) (e error, clientErr error)
Errors(ctx go_context.Context) (e1 error, e2 error, clientErr error)
MultiScalar(ctx go_context.Context) (e *MultiScalar, clientErr error)
Scalar(ctx go_context.Context) (e *ScalarError, clientErr error)
ScalarError(ctx go_context.Context) (e error, clientErr error)
Struct(ctx go_context.Context) (e *StructError, clientErr error)
StructError(ctx go_context.Context) (e error, clientErr error)
TypedCustomError(ctx go_context.Context) (e error, clientErr error)
TypedError(ctx go_context.Context) (e error, clientErr error)
TypedScalarError(ctx go_context.Context) (e error, clientErr error)
TypedWrappedError(ctx go_context.Context) (e error, clientErr error)
WrappedError(ctx go_context.Context) (e 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 StructError ¶
func (*StructError) Error ¶
func (s *StructError) Error() string
Click to show internal directories.
Click to hide internal directories.