grpc

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientBiStream

type ClientBiStream[OUT, IN any] struct {
	// contains filtered or unexported fields
}

func NewClientBiStream

func NewClientBiStream[REPLY proto.Message, OUT, IN any](
	cc *grpc.ClientConn,
	fullMethod string,
	enc EncodeFunc[OUT],
	dec DecodeFunc[IN],
	opts ...ClientOption,
) *ClientBiStream[OUT, IN]

func (*ClientBiStream[OUT, IN]) Endpoint

func (c *ClientBiStream[OUT, IN]) Endpoint() endpoint.BiStream[OUT, IN]

type ClientInnerStream

type ClientInnerStream[OUT, IN any] struct {
	// contains filtered or unexported fields
}

func NewClientInnerStream

func NewClientInnerStream[REPLY proto.Message, OUT, IN any](
	cc *grpc.ClientConn,
	fullMethod string,
	enc EncodeFunc[OUT],
	dec DecodeFunc[IN],
	opts ...ClientOption,
) *ClientInnerStream[OUT, IN]

func (*ClientInnerStream[OUT, IN]) Endpoint

func (c *ClientInnerStream[OUT, IN]) Endpoint() endpoint.InnerStream[OUT, IN]

type ClientOption

type ClientOption interface {
	// contains filtered or unexported methods
}

func WithClientAfter

func WithClientAfter(after kitgrpc.ClientResponseFunc) ClientOption

func WithClientBefore

func WithClientBefore(before kitgrpc.ClientRequestFunc) ClientOption

func WithClientCallOpt

func WithClientCallOpt(opt grpc.CallOption, opts ...grpc.CallOption) ClientOption

func WithClientErrorHandler

func WithClientErrorHandler(handler transport.ErrorHandler) ClientOption

func WithClientFinalizer

func WithClientFinalizer(finalize kitgrpc.ClientFinalizerFunc) ClientOption

type ClientOuterStream

type ClientOuterStream[OUT, IN any] struct {
	// contains filtered or unexported fields
}

func NewClientOuterStream

func NewClientOuterStream[REPLY proto.Message, OUT, IN any](
	cc *grpc.ClientConn,
	fullMethod string,
	enc EncodeFunc[OUT],
	dec DecodeFunc[IN],
	opts ...ClientOption,
) *ClientOuterStream[OUT, IN]

func (*ClientOuterStream[OUT, IN]) Endpoint

func (c *ClientOuterStream[OUT, IN]) Endpoint() endpoint.OuterStream[OUT, IN]

type ClientUnary

type ClientUnary[OUT, IN any] struct {
	// contains filtered or unexported fields
}

func NewClientUnary

func NewClientUnary[REPLY proto.Message, OUT, IN any](
	cc *grpc.ClientConn,
	fullMethod string,
	enc EncodeFunc[OUT],
	dec DecodeFunc[IN],
	opts ...ClientOption,
) *ClientUnary[OUT, IN]

func (*ClientUnary[OUT, IN]) Endpoint

func (c *ClientUnary[OUT, IN]) Endpoint() endpoint.Unary[OUT, IN]

type DecodeFunc

type DecodeFunc[T any] func(context.Context, proto.Message) (T, error)

type EncodeFunc

type EncodeFunc[T any] func(context.Context, T) (proto.Message, error)

type HandlerBiStream

type HandlerBiStream interface {
	ServeBiStream(grpc.ServerStream) (context.Context, error)
}

type HandlerInnerStream

type HandlerInnerStream interface {
	ServeInnerStream(proto.Message, grpc.ServerStream) (context.Context, error)
}

type HandlerOuterStream

type HandlerOuterStream interface {
	ServeOuterStream(grpc.ServerStream) (context.Context, error)
}

type HandlerUnary

type HandlerUnary interface {
	ServeUnary(context.Context, proto.Message) (context.Context, proto.Message, error)
}

type ServerBiStream

type ServerBiStream[IN, OUT any] struct {
	// contains filtered or unexported fields
}

func NewServerBiStream

func NewServerBiStream[RECEIVE proto.Message, IN, OUT any](
	e endpoint.BiStream[IN, OUT],
	dec DecodeFunc[IN],
	enc EncodeFunc[OUT],
	opts ...ServerOption,
) *ServerBiStream[IN, OUT]

func (ServerBiStream[IN, OUT]) ServeBiStream

func (srv ServerBiStream[IN, OUT]) ServeBiStream(s grpc.ServerStream) (ctx context.Context, err error)

type ServerInnerStream

type ServerInnerStream[IN, OUT any] struct {
	// contains filtered or unexported fields
}

func NewServerInnerStream

func NewServerInnerStream[IN, OUT any](
	e endpoint.InnerStream[IN, OUT],
	dec DecodeFunc[IN],
	enc EncodeFunc[OUT],
	opts ...ServerOption,
) *ServerInnerStream[IN, OUT]

func (ServerInnerStream[IN, OUT]) ServeInnerStream

func (srv ServerInnerStream[IN, OUT]) ServeInnerStream(req proto.Message, s grpc.ServerStream) (ctx context.Context, err error)

type ServerOption

type ServerOption interface {
	// contains filtered or unexported methods
}

func WithServerAfter

func WithServerAfter(after kitgrpc.ServerResponseFunc) ServerOption

func WithServerBefore

func WithServerBefore(before kitgrpc.ServerRequestFunc) ServerOption

func WithServerErrorHandler

func WithServerErrorHandler(handler transport.ErrorHandler) ServerOption

func WithServerFinalizer

func WithServerFinalizer(finalize kitgrpc.ServerFinalizerFunc) ServerOption

type ServerOuterStream

type ServerOuterStream[IN, OUT any] struct {
	// contains filtered or unexported fields
}

func NewServerOuterStream

func NewServerOuterStream[RECEIVE proto.Message, IN, OUT any](
	e endpoint.OuterStream[IN, OUT],
	dec DecodeFunc[IN],
	enc EncodeFunc[OUT],
	opts ...ServerOption,
) *ServerOuterStream[IN, OUT]

func (ServerOuterStream[IN, OUT]) ServeOuterStream

func (srv ServerOuterStream[IN, OUT]) ServeOuterStream(s grpc.ServerStream) (ctx context.Context, err error)

type ServerUnary

type ServerUnary[IN, OUT any] struct {
	// contains filtered or unexported fields
}

func NewServerUnary

func NewServerUnary[IN, OUT any](
	e endpoint.Unary[IN, OUT],
	dec DecodeFunc[IN],
	enc EncodeFunc[OUT],
	opts ...ServerOption,
) *ServerUnary[IN, OUT]

func (ServerUnary[IN, OUT]) ServeUnary

func (srv ServerUnary[IN, OUT]) ServeUnary(ctx context.Context, req proto.Message) (ctxt context.Context, resp proto.Message, err error)

Jump to

Keyboard shortcuts

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