Documentation ¶
Index ¶
- func NewClient(context context.Context, host string, params *ClientParams, ...) (*grpc.ClientConn, error)
- func NewServer(lc fx.Lifecycle, s fx.Shutdowner, params ServerParams, ...) *grpc.Server
- func StreamServerInterceptor() []grpc.StreamServerInterceptor
- func UnaryServerInterceptor() []grpc.UnaryServerInterceptor
- type ClientParams
- type Config
- type ServerParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient(context context.Context, host string, params *ClientParams, opts ...grpc.DialOption) (*grpc.ClientConn, error)
NewClient to host for gRPC.
func NewServer ¶
func NewServer(lc fx.Lifecycle, s fx.Shutdowner, params ServerParams, opts ...grpc.ServerOption) *grpc.Server
NewServer for gRPC.
func StreamServerInterceptor ¶ added in v1.17.0
func StreamServerInterceptor() []grpc.StreamServerInterceptor
StreamServerInterceptor for gRPC.
func UnaryServerInterceptor ¶ added in v1.17.0
func UnaryServerInterceptor() []grpc.UnaryServerInterceptor
UnaryServerInterceptor for gRPC.
Types ¶
type ClientParams ¶ added in v1.17.0
type ClientParams struct { Logger *zap.Logger Unary []grpc.UnaryClientInterceptor Stream []grpc.StreamClientInterceptor }
ClientParams for gRPC.
type Config ¶ added in v1.19.0
type Config struct {
Port string `envconfig:"GRPC_PORT" required:"true" default:"9090"`
}
Config for gRPC.
type ServerParams ¶ added in v1.17.0
type ServerParams struct { fx.In Config *Config Logger *zap.Logger Unary []grpc.UnaryServerInterceptor Stream []grpc.StreamServerInterceptor }
ServerParams for gRPC.
Click to show internal directories.
Click to hide internal directories.