grpc

package
v1.307.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2024 License: MIT Imports: 31 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

Module for fx.

Functions

func IsEnabled added in v1.143.2

func IsEnabled(cfg *Config) bool

IsEnabled for gRPC.

func NewClient

func NewClient(target string, opts ...ClientOption) (*grpc.ClientConn, error)

NewClient for gRPC.

func NewDialOptions added in v1.105.0

func NewDialOptions(opts ...ClientOption) []grpc.DialOption

NewDialOptions for gRPC.

func UnaryClientInterceptors added in v1.134.0

func UnaryClientInterceptors(opts ...ClientOption) []grpc.UnaryClientInterceptor

UnaryClientInterceptors for gRPC.

Types

type ClientOption added in v1.50.0

type ClientOption interface {
	// contains filtered or unexported methods
}

ClientOption for gRPC.

func WithClientBreaker added in v1.50.0

func WithClientBreaker() ClientOption

WithClientBreaker for gRPC.

func WithClientCompression added in v1.224.0

func WithClientCompression() ClientOption

WithClientBreaker 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 WithClientMetrics added in v1.65.0

func WithClientMetrics(meter metric.Meter) ClientOption

WithClientMetrics for gRPC.

func WithClientRetry added in v1.50.0

func WithClientRetry(cfg *retry.Config) ClientOption

WithClientRetry for gRPC.

func WithClientStreamInterceptors added in v1.50.0

func WithClientStreamInterceptors(stream ...grpc.StreamClientInterceptor) ClientOption

WithClientUnaryInterceptors for gRPC.

func WithClientTLS added in v1.180.0

func WithClientTLS(sec *st.Config) (ClientOption, error)

WithClientTLS for gRPC.

func WithClientTimeout added in v1.199.0

func WithClientTimeout(timeout string) ClientOption

WithClientTimeout for gRPC.

func WithClientTokenGenerator added in v1.204.0

func WithClientTokenGenerator(gen token.Generator) ClientOption

WithClientTokenGenerator for gRPC.

func WithClientTracer added in v1.52.0

func WithClientTracer(tracer trace.Tracer) ClientOption

WithClientTracer for gRPC.

func WithClientUnaryInterceptors added in v1.50.0

func WithClientUnaryInterceptors(unary ...grpc.UnaryClientInterceptor) ClientOption

WithClientUnaryInterceptors for gRPC.

func WithClientUserAgent added in v1.121.0

func WithClientUserAgent(userAgent env.UserAgent) ClientOption

WithUserAgent for gRPC.

type Config

type Config struct {
	*server.Config `yaml:",inline" json:",inline" toml:",inline"`
}

Config for gRPC.

type Server added in v1.70.0

type Server struct {
	// contains filtered or unexported fields
}

Server for gRPC.

func NewServer

func NewServer(params ServerParams) (*Server, error)

NewServer for gRPC.

func (*Server) Server added in v1.70.0

func (s *Server) Server() *grpc.Server

Server for gRPC.

func (*Server) Start added in v1.70.0

func (s *Server) Start()

Start the server.

func (*Server) Stop added in v1.70.0

func (s *Server) Stop(ctx context.Context)

Stop the server.

type ServerParams

type ServerParams struct {
	fx.In

	Shutdowner fx.Shutdowner

	Config    *Config
	Logger    *zap.Logger
	Tracer    trace.Tracer
	Meter     metric.Meter
	UserAgent env.UserAgent
	Version   env.Version
	Limiter   limiter.Store                  `optional:"true"`
	Key       lm.KeyFunc                     `optional:"true"`
	Verifier  token.Verifier                 `optional:"true"`
	Unary     []grpc.UnaryServerInterceptor  `optional:"true"`
	Stream    []grpc.StreamServerInterceptor `optional:"true"`
}

ServerParams for gRPC.

Directories

Path Synopsis
telemetry

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL