Documentation ¶
Index ¶
- func NewClient(ctx context.Context, addr string, credentials credentials.TransportCredentials, ...) (*grpc.ClientConn, error)
- func NewServer(logger *zap.Logger, extraOpts ...ServerOption) *grpc.Server
- func WithConn(conn net.Conn) grpc.DialOption
- type Handler
- func (h *Handler) HandleConn(ctx context.Context, connStats stats.ConnStats)
- func (h *Handler) HandleRPC(context.Context, stats.RPCStats)
- func (h *Handler) TagConn(ctx context.Context, connTagInfo *stats.ConnTagInfo) context.Context
- func (h *Handler) TagRPC(ctx context.Context, rpcTagInfo *stats.RPCTagInfo) context.Context
- type ServerOption
- func AuthorizationInterceptor(router *auth.AuthRouter) ServerOption
- func Credentials(creds credentials.TransportCredentials) ServerOption
- func DefaultTraceInterceptor() ServerOption
- func TraceInterceptor(tracer opentracing.Tracer) ServerOption
- func UnaryServerInterceptor(u grpc.UnaryServerInterceptor) ServerOption
- func VerifyInterceptor() ServerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient(ctx context.Context, addr string, credentials credentials.TransportCredentials, opts ...grpc.DialOption) (*grpc.ClientConn, error)
NewClient creates new gRPC client connection on given addr and wraps it with given credentials (if provided).
The address argument can be optionally used as other peer's verification using ETH authentication. To enable this the argument should be in format "ethAddr@Endpoint".
Types ¶
type Handler ¶
type Handler struct{}
func (*Handler) HandleConn ¶
HandleConn processes the Conn stats.
type ServerOption ¶
type ServerOption func(options *options)
func AuthorizationInterceptor ¶
func AuthorizationInterceptor(router *auth.AuthRouter) ServerOption
func Credentials ¶
func Credentials(creds credentials.TransportCredentials) ServerOption
Credentials activates credentials for server connections.
func DefaultTraceInterceptor ¶
func DefaultTraceInterceptor() ServerOption
func TraceInterceptor ¶
func TraceInterceptor(tracer opentracing.Tracer) ServerOption
func UnaryServerInterceptor ¶
func UnaryServerInterceptor(u grpc.UnaryServerInterceptor) ServerOption
UnaryServerInterceptor adds an unary interceptor to the chain.
func VerifyInterceptor ¶ added in v0.4.1
func VerifyInterceptor() ServerOption
VerifyInterceptor is an interceptor that performs server-side validation for both gRPC request and reply if possible.
It automatically checks whether those types has `Validate` method and calls it if so.
Click to show internal directories.
Click to hide internal directories.