AddGRPCServerOptions allows users to add custom gRPC server options such as TLS configuration, timeouts, interceptors, and other server-specific settings in a single call. Example: // Add TLS credentials and connection timeout in one call creds, _ := credentials.NewServerTLSFromFile("server-cert
(grpcOpts ...grpc.ServerOption)
| 48 | // This function accepts a variadic list of gRPC server options (grpc.ServerOption) and appends them |
| 49 | // to the server's configuration. It allows fine-tuning of the gRPC server's behavior during its initialization. |
| 50 | func (a *App) AddGRPCServerOptions(grpcOpts ...grpc.ServerOption) { |
| 51 | if len(grpcOpts) == 0 { |
| 52 | a.container.Logger.Debug("no gRPC server options provided") |
| 53 | return |
| 54 | } |
| 55 | |
| 56 | a.container.Logger.Debugf("adding %d gRPC server options", len(grpcOpts)) |
| 57 | a.grpcServer.options = append(a.grpcServer.options, grpcOpts...) |
| 58 | } |
| 59 | |
| 60 | // AddGRPCUnaryInterceptors allows users to add custom gRPC interceptors. |
| 61 | // Example: |