Documentation
¶
Index ¶
- func NewClient(context context.Context, host string, opts ...ClientOption) (*grpc.ClientConn, error)
- func NewServer(params ServerParams) *grpc.Server
- func StreamServerInterceptor() []grpc.StreamServerInterceptor
- func UnaryServerInterceptor() []grpc.UnaryServerInterceptor
- type ClientOption
- func WithClientBreaker() ClientOption
- func WithClientConfig(config *Config) ClientOption
- func WithClientDialOption(opts ...grpc.DialOption) ClientOption
- func WithClientLogger(logger *zap.Logger) ClientOption
- func WithClientRetry() ClientOption
- func WithClientSecure() ClientOption
- func WithClientStreamInterceptors(stream ...grpc.StreamClientInterceptor) ClientOption
- func WithClientTracer(tracer opentracing.Tracer) ClientOption
- func WithClientUnaryInterceptors(unary ...grpc.UnaryClientInterceptor) ClientOption
- func WithClientVersion(version version.Version) 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, opts ...ClientOption) (*grpc.ClientConn, error)
NewClient to host 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.
func WithClientConfig ¶ added in v1.52.0
func WithClientConfig(config *Config) ClientOption
WithClientConfig for gRPC.
func WithClientDialOption ¶ added in v1.50.0
func WithClientDialOption(opts ...grpc.DialOption) ClientOption
WithClientDialOption for gRPC.
func WithClientLogger ¶ added in v1.52.0
func WithClientLogger(logger *zap.Logger) ClientOption
WithClientLogger for gRPC.
func WithClientRetry ¶ added in v1.50.0
func WithClientRetry() ClientOption
WithClientRetry for gRPC.
func WithClientSecure ¶ added in v1.50.0
func WithClientSecure() ClientOption
WithClientSecure for gRPC.
func WithClientStreamInterceptors ¶ added in v1.50.0
func WithClientStreamInterceptors(stream ...grpc.StreamClientInterceptor) ClientOption
WithClientUnaryInterceptors for gRPC.
func WithClientTracer ¶ added in v1.52.0
func WithClientTracer(tracer opentracing.Tracer) ClientOption
WithClientConfig for gRPC.
func WithClientUnaryInterceptors ¶ added in v1.50.0
func WithClientUnaryInterceptors(unary ...grpc.UnaryClientInterceptor) ClientOption
WithClientUnaryInterceptors for gRPC.
func WithClientVersion ¶ added in v1.61.0
func WithClientVersion(version version.Version) ClientOption
WithClientVersion for gRPC.
type Config ¶
type Config struct { Port string `yaml:"port"` Retry retry.Config `yaml:"retry"` UserAgent string `yaml:"user_agent"` }
Config for gRPC.
type ServerParams ¶
type ServerParams struct { fx.In Lifecycle fx.Lifecycle Shutdowner fx.Shutdowner Config *Config Logger *zap.Logger Tracer opentracing.Tracer Version version.Version Unary []grpc.UnaryServerInterceptor Stream []grpc.StreamServerInterceptor }
ServerParams for gRPC.
Click to show internal directories.
Click to hide internal directories.