Documentation ¶
Overview ¶
Package grpc provides opinionated production-ready gRPC server.
It also redirect gRPC log to slog using init function.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*options)
Option configures the runner for the gRPC server.
func WithAddress ¶
WithAddress provides the address listened by the gRPC server. It should be either tcp address like `:8080` or unix socket address like `unix:nilgo.sock`.
By default, it listens on `localhost:8080` or `:${PORT}` if the environment variable exists.
func WithConfigService ¶
WithConfigService registers the pb.ConfigServiceServer implement to the gRPC server.
It uses the global konf.Config if the configs are not provided.
Click to show internal directories.
Click to hide internal directories.