Documentation ¶
Index ¶
- func NewClient(context context.Context, host string, config *Config, logger *zap.Logger, ...) (*grpc.ClientConn, error)
- func NewServer(lc fx.Lifecycle, s fx.Shutdowner, params ServerParams, ...) *grpc.Server
- func StreamServerInterceptor() []grpc.StreamServerInterceptor
- func UnaryServerInterceptor() []grpc.UnaryServerInterceptor
- type ClientOption
- func WithClientBreaker() ClientOption
- func WithClientDialOption(opts ...grpc.DialOption) ClientOption
- func WithClientRetry() ClientOption
- func WithClientSecure() ClientOption
- func WithClientStreamInterceptors(stream ...grpc.StreamClientInterceptor) ClientOption
- func WithClientUnaryInterceptors(unary ...grpc.UnaryClientInterceptor) ClientOption
- type Config
- type ServerParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient(context context.Context, host string, config *Config, logger *zap.Logger, opts ...ClientOption) (*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 ¶
func StreamServerInterceptor() []grpc.StreamServerInterceptor
StreamServerInterceptor for gRPC.
func UnaryServerInterceptor ¶
func UnaryServerInterceptor() []grpc.UnaryServerInterceptor
UnaryServerInterceptor for gRPC.
Types ¶
type ClientOption ¶ added in v1.50.0
type ClientOption interface {
// contains filtered or unexported methods
}
ClientOption for HTTP.
func WithClientBreaker ¶ added in v1.50.0
func WithClientBreaker() ClientOption
WithClientBreaker for gRPC. nolint:ireturn
func WithClientDialOption ¶ added in v1.50.0
func WithClientDialOption(opts ...grpc.DialOption) ClientOption
WithClientDialOption for gRPC. nolint:ireturn
func WithClientRetry ¶ added in v1.50.0
func WithClientRetry() ClientOption
WithClientRetry for gRPC. nolint:ireturn
func WithClientSecure ¶ added in v1.50.0
func WithClientSecure() ClientOption
WithClientSecure for gRPC. nolint:ireturn
func WithClientStreamInterceptors ¶ added in v1.50.0
func WithClientStreamInterceptors(stream ...grpc.StreamClientInterceptor) ClientOption
WithClientUnaryInterceptors for gRPC. nolint:ireturn
func WithClientUnaryInterceptors ¶ added in v1.50.0
func WithClientUnaryInterceptors(unary ...grpc.UnaryClientInterceptor) ClientOption
WithClientUnaryInterceptors for gRPC. nolint:ireturn
type Config ¶
type Config struct { Port string `yaml:"port"` UserAgent string `yaml:"user_agent"` Retry retry.Config `yaml:"retry"` RateLimit ratelimit.Config `yaml:"rate_limit"` }
Config for gRPC.
type ServerParams ¶
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.