Documentation
¶
Overview ¶
Package grpc provides a gRPC server which implements the app.Runtime interface.
Index ¶
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 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 TransportCredentials ¶
func TransportCredentials(tc credentials.TransportCredentials) RuntimeOption
TransportCredentials configures the gRPC transport credentials which the gRPC server uses.
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.