gRPC
Functions
Public API reference for the gRPC extension
| Function | Description |
|---|
NewExtension(opts ...ConfigOption) forge.Extension | Create the gRPC extension with functional options |
NewExtensionWithConfig(config Config) forge.Extension | Create the gRPC extension with a complete config |
DefaultConfig() Config | Returns the default configuration |
| Method | Description |
|---|
RegisterService(desc *grpc.ServiceDesc, impl any) | Register a gRPC service implementation |
GetServiceInfo() []ServiceInfo | List all registered services and their methods |
| Method | Description |
|---|
Start(ctx) error | Start the gRPC server listener |
Stop(ctx) error | Graceful shutdown of the server |
Health(ctx) error | Run health checks on registered services |
| Method | Description |
|---|
AddUnaryInterceptor(interceptor) | Add a unary server interceptor |
AddStreamInterceptor(interceptor) | Add a stream server interceptor |
| Method | Description |
|---|
RegisterHealthChecker(name, checker) | Register a named health checker |
SetServingStatus(service, status) | Set the serving status for a service |
| Method | Description |
|---|
Stats() ServerStats | Get server statistics |
GetServer() *grpc.Server | Access the underlying grpc.Server |
| Field | Type | Purpose |
|---|
Name | string | Fully qualified service name |
Methods | []MethodInfo | Service methods |
Description | string | Service description |
| Field | Type | Purpose |
|---|
Name | string | Method name |
IsClientStream | bool | Client streams requests |
IsServerStream | bool | Server streams responses |
InputType | string | Input message type |
OutputType | string | Output message type |
How is this guide?