Documentation ¶
Overview ¶
Package grpc provides a gRPC server which implements the app.Runtime interface.
Index ¶
- type Runtime
- type RuntimeOption
- func ChainStreamInterceptor(interceptors ...grpc.StreamServerInterceptor) RuntimeOption
- func ChainUnaryInterceptor(interceptors ...grpc.UnaryServerInterceptor) RuntimeOption
- func ListenOnPort(port uint) RuntimeOption
- func LogHandler(h slog.Handler) RuntimeOption
- func Service(f func(*grpc.Server), opts ...ServiceOption) RuntimeOption
- func StreamInterceptor(i grpc.StreamServerInterceptor) RuntimeOption
- func TransportCredentials(tc credentials.TransportCredentials) RuntimeOption
- func UnaryInterceptor(f grpc.UnaryServerInterceptor) RuntimeOption
- type ServiceOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime is a bedrock.Runtime for running a gRPC service.
func NewRuntime ¶
func NewRuntime(opts ...RuntimeOption) *Runtime
NewRuntime returns a fully initialized gRPC Runtime.
type RuntimeOption ¶
type RuntimeOption func(*runtimeOptions)
RuntimeOption are options for configuring the gRPC runtime.
func ChainStreamInterceptor ¶ added in v0.4.2
func ChainStreamInterceptor(interceptors ...grpc.StreamServerInterceptor) RuntimeOption
ChainStreamInterceptor configires the gRPC server for multiple server interceptors, please refer to grpc.ChainStreamInterceptor for more information
func ChainUnaryInterceptor ¶ added in v0.4.2
func ChainUnaryInterceptor(interceptors ...grpc.UnaryServerInterceptor) RuntimeOption
ChainUnaryInterceptor configures the gRPC server for multiple unary interceptors, please refer to grpc.ChainUnaryInterceptor for more information
func ListenOnPort ¶
func ListenOnPort(port uint) RuntimeOption
ListenOnPort will configure the HTTP server to listen on the given port.
Default port is 8080.
func LogHandler ¶
func LogHandler(h slog.Handler) RuntimeOption
LogHandler configures the underlying slog.Handler.
func Service ¶
func Service(f func(*grpc.Server), opts ...ServiceOption) RuntimeOption
Service registers a gRPC service with the underlying gRPC server.
func StreamInterceptor ¶ added in v0.4.2
func StreamInterceptor(i grpc.StreamServerInterceptor) RuntimeOption
StreamInterceptor configures the gRPC server for one server interceptor, please refer to grpc.StreamInterceptor for more information
func TransportCredentials ¶
func TransportCredentials(tc credentials.TransportCredentials) RuntimeOption
TransportCredentials configures the gRPC transport credentials which the gRPC server uses.
func UnaryInterceptor ¶ added in v0.4.2
func UnaryInterceptor(f grpc.UnaryServerInterceptor) RuntimeOption
UnaryInterceptor configures the gRPC server for one unary interceptors, please refer to grpc.UnaryInterceptor for more information
type ServiceOption ¶
type ServiceOption func(*serviceOptions)
ServiceOption are options for configuring the gRPC health service.
func Readiness ¶
func Readiness(m health.Metric) ServiceOption
Readiness configures the health readiness metric for the gRPC service.
func ServiceName ¶
func ServiceName(name string) ServiceOption
ServiceName configures the service name which will be reported by the gRPC health service.