Documentation ¶
Overview ¶
In Processing server uses memory to transfer data between the server and the client This is ideal for testing propose as it not require networking to run integration testes
Index ¶
- func GetBufDialer(listener *bufconn.Listener) func(context.Context, string) (net.Conn, error)
- func GetInProcessingClientConn(ctx context.Context, listener *bufconn.Listener, options []grpc.DialOption) (*grpc.ClientConn, error)
- func GetInProcessingGRPCServer(options []grpc.ServerOption) (*grpc.Server, *bufconn.Listener)
- type GrpcInProcessingServer
- type GrpcInProcessingServerBuilder
- func (sb *GrpcInProcessingServerBuilder) AddOption(o grpc.ServerOption)
- func (sb *GrpcInProcessingServerBuilder) Build() GrpcInProcessingServer
- func (sb *GrpcInProcessingServerBuilder) SetStreamInterceptors(interceptors []grpc.StreamServerInterceptor)
- func (sb *GrpcInProcessingServerBuilder) SetTlsCert(cert *tls.Certificate)
- func (sb *GrpcInProcessingServerBuilder) SetUnaryInterceptors(interceptors []grpc.UnaryServerInterceptor)
- type InProcessingClientBuilder
- func (b *InProcessingClientBuilder) GetConn(addr string, port string) (*grpc.ClientConn, error)
- func (b *InProcessingClientBuilder) WithContext(ctx context.Context)
- func (b *InProcessingClientBuilder) WithInsecure()
- func (b *InProcessingClientBuilder) WithOptions(opts ...grpc.DialOption)
- func (b *InProcessingClientBuilder) WithStreamInterceptors(interceptors []grpc.StreamClientInterceptor)
- func (b *InProcessingClientBuilder) WithUnaryInterceptors(interceptors []grpc.UnaryClientInterceptor)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBufDialer ¶
func GetInProcessingClientConn ¶
func GetInProcessingClientConn(ctx context.Context, listener *bufconn.Listener, options []grpc.DialOption) (*grpc.ClientConn, error)
Types ¶
type GrpcInProcessingServer ¶
type GrpcInProcessingServer interface { Start() error AwaitTermination(shutdownHook func()) RegisterService(reg func(*grpc.Server)) Cleanup() GetListener() *bufconn.Listener }
GRPC server interface
type GrpcInProcessingServerBuilder ¶
type GrpcInProcessingServerBuilder struct {
// contains filtered or unexported fields
}
GRPC in-processing server builder
func (*GrpcInProcessingServerBuilder) AddOption ¶
func (sb *GrpcInProcessingServerBuilder) AddOption(o grpc.ServerOption)
DialOption configures how we set up the connection.
func (*GrpcInProcessingServerBuilder) Build ¶
func (sb *GrpcInProcessingServerBuilder) Build() GrpcInProcessingServer
Build is responsible for building a Fiji GRPC server
func (*GrpcInProcessingServerBuilder) SetStreamInterceptors ¶
func (sb *GrpcInProcessingServerBuilder) SetStreamInterceptors(interceptors []grpc.StreamServerInterceptor)
SetStreamInterceptors set a list of interceptors to the Grpc server for stream connection By default, gRPC doesn't allow one to have more than one interceptor either on the client nor on the server side. By using `grpc_middleware` we are able to provides convenient method to add a list of interceptors
func (*GrpcInProcessingServerBuilder) SetTlsCert ¶
func (sb *GrpcInProcessingServerBuilder) SetTlsCert(cert *tls.Certificate)
SetTlsCert sets credentials for server connections
func (*GrpcInProcessingServerBuilder) SetUnaryInterceptors ¶
func (sb *GrpcInProcessingServerBuilder) SetUnaryInterceptors(interceptors []grpc.UnaryServerInterceptor)
SetUnaryInterceptors set a list of interceptors to the Grpc server for unary connection By default, gRPC doesn't allow one to have more than one interceptor either on the client nor on the server side. By using `grpc_middleware` we are able to provides convenient method to add a list of interceptors
type InProcessingClientBuilder ¶
type InProcessingClientBuilder struct { Server GrpcInProcessingServer // contains filtered or unexported fields }
func (*InProcessingClientBuilder) GetConn ¶
func (b *InProcessingClientBuilder) GetConn(addr string, port string) (*grpc.ClientConn, error)
GetConn returns the client connection to the Server
func (*InProcessingClientBuilder) WithContext ¶
func (b *InProcessingClientBuilder) WithContext(ctx context.Context)
WithContext set the context to be used in the dial
func (*InProcessingClientBuilder) WithInsecure ¶
func (b *InProcessingClientBuilder) WithInsecure()
WithInsecure set the connection as insecure
func (*InProcessingClientBuilder) WithOptions ¶
func (b *InProcessingClientBuilder) WithOptions(opts ...grpc.DialOption)
WithOptions set dial options
func (*InProcessingClientBuilder) WithStreamInterceptors ¶
func (b *InProcessingClientBuilder) WithStreamInterceptors(interceptors []grpc.StreamClientInterceptor)
WithUnaryInterceptors set a list of interceptors to the Grpc client for stream connection By default, gRPC doesn't allow one to have more than one interceptor either on the client nor on the Server side. By using `grpc_middleware` we are able to provides convenient method to add a list of interceptors
func (*InProcessingClientBuilder) WithUnaryInterceptors ¶
func (b *InProcessingClientBuilder) WithUnaryInterceptors(interceptors []grpc.UnaryClientInterceptor)
WithUnaryInterceptors set a list of interceptors to the Grpc client for unary connection By default, gRPC doesn't allow one to have more than one interceptor either on the client nor on the Server side. By using `grpc_middleware` we are able to provides convenient method to add a list of interceptors