Documentation ¶
Index ¶
- Variables
- func GetEndpointConfig(methodPrefix string, f reflect.StructField) structure.EndpointDescriptor
- func GetEndpoints(methodPrefix string, handlersStructs ...interface{}) []structure.EndpointDescriptor
- func ResolveBody(msg *isp.Message) *proto.Value
- func ResolveError(err error) (s *status.Status, ok bool)
- func ServerIsInitialized() bool
- func StartBackendGrpcServer(addr structure.AddressConfiguration, service *DefaultService, ...)
- func StartBackendGrpcServerOn(addr structure.AddressConfiguration, ln net.Listener, service *DefaultService, ...)
- func StopGrpcServer()
- func UpdateHandlers(methodPrefix string, handlersStructs ...interface{}) error
- func WrapBody(value *proto.Value) *isp.Message
- type DefaultService
- func (df *DefaultService) Request(ctx context.Context, msg *isp.Message) (*isp.Message, error)
- func (df *DefaultService) RequestStream(stream isp.BackendService_RequestStreamServer) error
- func (df *DefaultService) WithErrorHandler(eh ErrorHandler) *DefaultService
- func (df *DefaultService) WithInterceptor(interceptor Interceptor) *DefaultService
- func (df *DefaultService) WithPostProcessors(pps ...PostProcessor) *DefaultService
- func (df *DefaultService) WithValidator(validator Validator) *DefaultService
- type ErrorHandler
- type GrpcServer
- type Interceptor
- type InternalGrpcClient
- func (client *InternalGrpcClient) Close(errorHandler errorHandler)
- func (client *InternalGrpcClient) CloseQuietly()
- func (client *InternalGrpcClient) Conn() (isp.BackendServiceClient, error)
- func (client *InternalGrpcClient) Invoke(method string, callerId int, requestBody, responsePointer interface{}, ...) error
- func (client *InternalGrpcClient) InvokeStream(method string, callerId int, consumer streaming.StreamConsumer) error
- func (client *InternalGrpcClient) InvokeWithDynamicStruct(method string, callerId int, requestBody interface{}, opts ...InvokeOption) (interface{}, error)
- func (client *InternalGrpcClient) WithMetric(catchMetric func(method string, dur time.Duration, err error)) *InternalGrpcClient
- type InvokeOption
- type PostProcessor
- type RequestCtx
- type RxGrpcClient
- type RxOption
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoAliveConnections = errors.New("no alive connections")
)
Functions ¶
func GetEndpointConfig ¶ added in v1.2.1
func GetEndpointConfig(methodPrefix string, f reflect.StructField) structure.EndpointDescriptor
Deprecated
func GetEndpoints ¶
func GetEndpoints(methodPrefix string, handlersStructs ...interface{}) []structure.EndpointDescriptor
Deprecated
func ServerIsInitialized ¶
func ServerIsInitialized() bool
func StartBackendGrpcServer ¶
func StartBackendGrpcServer(addr structure.AddressConfiguration, service *DefaultService, opt ...grpc.ServerOption)
func StartBackendGrpcServerOn ¶
func StartBackendGrpcServerOn(addr structure.AddressConfiguration, ln net.Listener, service *DefaultService, opt ...grpc.ServerOption)
func StopGrpcServer ¶
func StopGrpcServer()
func UpdateHandlers ¶
Types ¶
type DefaultService ¶
type DefaultService struct {
// contains filtered or unexported fields
}
func GetDefaultService ¶
func GetDefaultService(methodPrefix string, handlersStructs ...interface{}) *DefaultService
Deprecated
func NewDefaultService ¶
func NewDefaultService(descriptors []structure.EndpointDescriptor) *DefaultService
func (*DefaultService) Request ¶
func (df *DefaultService) Request(ctx context.Context, msg *isp.Message) (*isp.Message, error)
func (*DefaultService) RequestStream ¶
func (df *DefaultService) RequestStream(stream isp.BackendService_RequestStreamServer) error
func (*DefaultService) WithErrorHandler ¶
func (df *DefaultService) WithErrorHandler(eh ErrorHandler) *DefaultService
func (*DefaultService) WithInterceptor ¶ added in v1.2.1
func (df *DefaultService) WithInterceptor(interceptor Interceptor) *DefaultService
func (*DefaultService) WithPostProcessors ¶ added in v1.4.0
func (df *DefaultService) WithPostProcessors(pps ...PostProcessor) *DefaultService
func (*DefaultService) WithValidator ¶ added in v1.4.0
func (df *DefaultService) WithValidator(validator Validator) *DefaultService
type ErrorHandler ¶
type GrpcServer ¶
type Interceptor ¶ added in v1.2.1
type Interceptor func(ctx RequestCtx, proceed func() (interface{}, error)) (interface{}, error)
type InternalGrpcClient ¶
type InternalGrpcClient struct {
// contains filtered or unexported fields
}
func NewGrpcClient ¶
func NewGrpcClient(addr string, options ...grpc.DialOption) (*InternalGrpcClient, error)
func NewGrpcClientV2 ¶
func NewGrpcClientV2(addrList []string, errorHandler errorHandler, options ...grpc.DialOption) (*InternalGrpcClient, error)
func (*InternalGrpcClient) Close ¶
func (client *InternalGrpcClient) Close(errorHandler errorHandler)
func (*InternalGrpcClient) CloseQuietly ¶
func (client *InternalGrpcClient) CloseQuietly()
func (*InternalGrpcClient) Conn ¶ added in v1.1.2
func (client *InternalGrpcClient) Conn() (isp.BackendServiceClient, error)
func (*InternalGrpcClient) Invoke ¶
func (client *InternalGrpcClient) Invoke(method string, callerId int, requestBody, responsePointer interface{}, opts ...InvokeOption) error
func (*InternalGrpcClient) InvokeStream ¶ added in v1.3.0
func (client *InternalGrpcClient) InvokeStream(method string, callerId int, consumer streaming.StreamConsumer) error
func (*InternalGrpcClient) InvokeWithDynamicStruct ¶ added in v1.6.3
func (client *InternalGrpcClient) InvokeWithDynamicStruct(method string, callerId int, requestBody interface{}, opts ...InvokeOption) (interface{}, error)
func (*InternalGrpcClient) WithMetric ¶
func (client *InternalGrpcClient) WithMetric(catchMetric func(method string, dur time.Duration, err error)) *InternalGrpcClient
type InvokeOption ¶ added in v1.9.0
type InvokeOption func(opts *invokeOpts)
func WithMetadata ¶ added in v1.9.0
func WithMetadata(md metadata.MD) InvokeOption
func WithTimeout ¶ added in v1.9.0
func WithTimeout(timeout time.Duration) InvokeOption
type PostProcessor ¶ added in v1.4.0
type PostProcessor func(ctx RequestCtx)
type RequestCtx ¶ added in v1.4.0
type RxGrpcClient ¶
type RxGrpcClient struct { *InternalGrpcClient // contains filtered or unexported fields }
func NewRxGrpcClient ¶
func NewRxGrpcClient(opts ...RxOption) *RxGrpcClient
func (*RxGrpcClient) Close ¶
func (rc *RxGrpcClient) Close()
func (*RxGrpcClient) ReceiveAddressList ¶
func (rc *RxGrpcClient) ReceiveAddressList(list []structure.AddressConfiguration) bool
func (*RxGrpcClient) Visit ¶
func (rc *RxGrpcClient) Visit(visitor func(c *InternalGrpcClient) error) error
type RxOption ¶
type RxOption func(rc *RxGrpcClient)
func WithDialOptions ¶
func WithDialOptions(opts ...grpc.DialOption) RxOption
func WithDialingErrorHandler ¶
func WithDialingErrorHandler(eh errorHandler) RxOption
type Validator ¶ added in v1.4.0
type Validator func(ctx RequestCtx, mappedRequestBody interface{}) error
Click to show internal directories.
Click to hide internal directories.