transport

package
v1.112.3 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Unlicense Imports: 12 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// GRPCModule for fx.
	GRPCModule = fx.Options(
		fx.Provide(grpc.NewServer),
		fx.Provide(grpc.UnaryServerInterceptor),
		fx.Provide(grpc.StreamServerInterceptor),
		fx.Provide(gtracer.NewTracer),
	)

	// HTTPModule for fx.
	HTTPModule = fx.Options(
		fx.Provide(http.NewServer),
		fx.Provide(htracer.NewTracer),
	)

	// NSQModule for fx.
	NSQModule = fx.Options(
		fx.Provide(ntracer.NewTracer),
		fx.Provide(nsq.NewMsgPackMarshaller),
	)

	// Module for fx.
	Module = fx.Options(
		GRPCModule,
		HTTPModule,
		NSQModule,
		fx.Invoke(Register),
	)
)
View Source
var ErrInvalidPort = errors.New("invalid port")

ErrInvalidPort for transport.

Functions

func Register added in v1.70.0

func Register(params RegisterParams)

Register all the transports.

Types

type Config

type Config struct {
	GRPC grpc.Config `yaml:"grpc" json:"grpc" toml:"grpc"`
	HTTP http.Config `yaml:"http" json:"http" toml:"http"`
	NSQ  nsq.Config  `yaml:"nsq" json:"nsq" toml:"nsq"`
}

Config for transport.

type RegisterParams added in v1.70.0

type RegisterParams struct {
	fx.In

	Lifecycle fx.Lifecycle
	Config    *Config
	HTTP      *http.Server
	GRPC      *grpc.Server
}

RegisterParams for transport.

Jump to

Keyboard shortcuts

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