Documentation
¶
Index ¶
- func NewBackend() backends.Backend
- type Backend
- func (b *Backend) GetMode() string
- func (b *Backend) Logger() backends.MiddlewareFunc
- func (b *Backend) NewEngine() backends.Engine
- func (b *Backend) NewEngineWithDefaults() backends.Engine
- func (b *Backend) NewServer(port int, engine backends.Engine) backends.Server
- func (b *Backend) NewServerWithAddr(addr string, engine backends.Engine) backends.Server
- func (b *Backend) NewServerWithAddrAndHandler(addr string, handler RPCHandler) backends.Server
- func (b *Backend) NewServerWithHandler(port int, handler RPCHandler) backends.Server
- func (b *Backend) Recovery() backends.MiddlewareFunc
- func (b *Backend) SetMode(mode string)
- type ColoniesServiceImpl
- type GRPCServer
- func (s *GRPCServer) Engine() backends.Engine
- func (s *GRPCServer) GRPCServer() *grpclib.Server
- func (s *GRPCServer) GetAddr() string
- func (s *GRPCServer) HTTPServer() *http.Server
- func (s *GRPCServer) ListenAndServe() error
- func (s *GRPCServer) ListenAndServeTLS(certFile, keyFile string) error
- func (s *GRPCServer) SetAddr(addr string)
- func (s *GRPCServer) SetHandler(handler RPCHandler)
- func (s *GRPCServer) SetIdleTimeout(timeout time.Duration)
- func (s *GRPCServer) SetReadHeaderTimeout(timeout time.Duration)
- func (s *GRPCServer) SetReadTimeout(timeout time.Duration)
- func (s *GRPCServer) SetWriteTimeout(timeout time.Duration)
- func (s *GRPCServer) Shutdown(ctx context.Context) error
- func (s *GRPCServer) ShutdownWithTimeout(timeout time.Duration) error
- type RPCHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend implements the backends.Backend interface for gRPC
func (*Backend) Logger ¶
func (b *Backend) Logger() backends.MiddlewareFunc
Logger returns a no-op middleware as gRPC handles logging differently
func (*Backend) NewEngineWithDefaults ¶
NewEngineWithDefaults panics as gRPC doesn't use the Engine pattern
func (*Backend) NewServer ¶
NewServer creates a new gRPC server with the given port and handler The engine parameter is ignored for gRPC as it doesn't use the Engine pattern
func (*Backend) NewServerWithAddr ¶
NewServerWithAddr creates a new gRPC server with the given address
func (*Backend) NewServerWithAddrAndHandler ¶
func (b *Backend) NewServerWithAddrAndHandler(addr string, handler RPCHandler) backends.Server
NewServerWithAddrAndHandler creates a new gRPC server with address and handler
func (*Backend) NewServerWithHandler ¶
func (b *Backend) NewServerWithHandler(port int, handler RPCHandler) backends.Server
NewServerWithHandler creates a new gRPC server with an RPC handler
func (*Backend) Recovery ¶
func (b *Backend) Recovery() backends.MiddlewareFunc
Recovery returns a no-op middleware as gRPC handles panics differently
type ColoniesServiceImpl ¶
type ColoniesServiceImpl struct {
proto.UnimplementedColoniesServiceServer
// contains filtered or unexported fields
}
ColoniesServiceImpl implements the gRPC ColoniesService
func NewColoniesServiceImpl ¶
func NewColoniesServiceImpl(handler RPCHandler) *ColoniesServiceImpl
NewColoniesServiceImpl creates a new gRPC service implementation
func (*ColoniesServiceImpl) CheckHealth ¶
func (s *ColoniesServiceImpl) CheckHealth(ctx context.Context, req *proto.HealthRequest) (*proto.HealthResponse, error)
CheckHealth handles health check requests
func (*ColoniesServiceImpl) SendMessage ¶
func (s *ColoniesServiceImpl) SendMessage(ctx context.Context, req *proto.RPCRequest) (*proto.RPCResponse, error)
SendMessage handles incoming RPC messages
type GRPCServer ¶
type GRPCServer struct {
// contains filtered or unexported fields
}
GRPCServer wraps a gRPC server to implement backends.Server interface
func NewGRPCServer ¶
func NewGRPCServer(port int, handler RPCHandler) *GRPCServer
NewGRPCServer creates a new gRPC server wrapper
func NewGRPCServerWithAddr ¶
func NewGRPCServerWithAddr(addr string, handler RPCHandler) *GRPCServer
NewGRPCServerWithAddr creates a new gRPC server with a specific address
func (*GRPCServer) Engine ¶
func (s *GRPCServer) Engine() backends.Engine
Engine returns nil as gRPC doesn't use the Engine pattern
func (*GRPCServer) GRPCServer ¶
func (s *GRPCServer) GRPCServer() *grpclib.Server
GRPCServer returns the underlying gRPC server
func (*GRPCServer) GetAddr ¶
func (s *GRPCServer) GetAddr() string
GetAddr returns the server address
func (*GRPCServer) HTTPServer ¶
func (s *GRPCServer) HTTPServer() *http.Server
HTTPServer returns nil as gRPC server is not an HTTP server
func (*GRPCServer) ListenAndServe ¶
func (s *GRPCServer) ListenAndServe() error
ListenAndServe starts the gRPC server
func (*GRPCServer) ListenAndServeTLS ¶
func (s *GRPCServer) ListenAndServeTLS(certFile, keyFile string) error
ListenAndServeTLS starts the gRPC server with TLS
func (*GRPCServer) SetAddr ¶
func (s *GRPCServer) SetAddr(addr string)
SetAddr sets the server address
func (*GRPCServer) SetHandler ¶
func (s *GRPCServer) SetHandler(handler RPCHandler)
SetHandler sets the RPC handler (must be called before ListenAndServe)
func (*GRPCServer) SetIdleTimeout ¶
func (s *GRPCServer) SetIdleTimeout(timeout time.Duration)
SetIdleTimeout is a no-op for gRPC
func (*GRPCServer) SetReadHeaderTimeout ¶
func (s *GRPCServer) SetReadHeaderTimeout(timeout time.Duration)
SetReadHeaderTimeout is a no-op for gRPC
func (*GRPCServer) SetReadTimeout ¶
func (s *GRPCServer) SetReadTimeout(timeout time.Duration)
SetReadTimeout is a no-op for gRPC (gRPC handles timeouts differently)
func (*GRPCServer) SetWriteTimeout ¶
func (s *GRPCServer) SetWriteTimeout(timeout time.Duration)
SetWriteTimeout is a no-op for gRPC
func (*GRPCServer) Shutdown ¶
func (s *GRPCServer) Shutdown(ctx context.Context) error
Shutdown gracefully shuts down the gRPC server
func (*GRPCServer) ShutdownWithTimeout ¶
func (s *GRPCServer) ShutdownWithTimeout(timeout time.Duration) error
ShutdownWithTimeout shuts down with a timeout
type RPCHandler ¶
RPCHandler is an interface for handling RPC messages