Functions
Public API reference for the gRPC extension
Extension Entry Points01
| 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 |
GRPC Interface -- Service Registration02
| Method | Description |
RegisterService(desc *grpc.ServiceDesc, impl any) | Register a gRPC service implementation |
GetServiceInfo() []ServiceInfo | List all registered services and their methods |
GRPC Interface -- Server Lifecycle03
| 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 |
GRPC Interface -- Interceptors04
| Method | Description |
AddUnaryInterceptor(interceptor) | Add a unary server interceptor |
AddStreamInterceptor(interceptor) | Add a stream server interceptor |
GRPC Interface -- Health05
| Method | Description |
RegisterHealthChecker(name, checker) | Register a named health checker |
SetServingStatus(service, status) | Set the serving status for a service |
GRPC Interface -- Stats06
| Method | Description |
Stats() ServerStats | Get server statistics |
GetServer() *grpc.Server | Access the underlying grpc.Server |
Key Types07
ServiceInfo
| Field | Type | Purpose |
Name | string | Fully qualified service name |
Methods | []MethodInfo | Service methods |
Description | string | Service description |
MethodInfo
| 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 |