grpc

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = types.Module{
	{CreateFunc: NewGRPCConfig},
	{CreateFunc: NewGRPC},
	{CreateFunc: Adapter},
}

Functions

This section is empty.

Types

type AdapterIn

type AdapterIn struct {
	dig.In

	Server *Server
}

type AdapterOut

type AdapterOut struct {
	dig.Out

	Server types.Runnable `group:"servers"`
}

func Adapter

func Adapter(in AdapterIn) AdapterOut

type Config

type Config struct {
	ListenAddr        string
	WithReflection    bool
	KeepaliveTime     time.Duration
	KeepaliveTimeout  time.Duration
	WithDebugLog      bool
	WithServerMetrics bool
	SensitiveData     *protoimpl.ExtensionInfo
}

func NewGRPCConfig

func NewGRPCConfig(cfg *config.Config) *Config

type Definition

type Definition struct {
	Description    *grpc.ServiceDesc
	Implementation any
}

type Params

type Params struct {
	dig.In

	GRPCDefinitions             []Definition                    `group:"grpc_impl"`
	GRPCUnaryCustomInterceptors [][]grpc.UnaryServerInterceptor `group:"grpc_unary_interceptor"`
	ServerOpt                   []ServerOpt                     `group:"grpc_server_opt"`
}

type Server

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

func NewGRPC

func NewGRPC(
	p Params,
	cfg *Config,
	logger *zap.Logger,
	tracer *apm.Tracer,
) *Server

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

func (*Server) Stop

func (s *Server) Stop(_ context.Context) error

type ServerOpt added in v1.0.23

type ServerOpt func(*Config)

func WithSensitiveData added in v1.0.23

func WithSensitiveData(sensitiveData *protoimpl.ExtensionInfo) ServerOpt

Jump to

Keyboard shortcuts

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