connectrpcofx

package
v0.0.0-...-5d15e42 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module("connectrpc",
	provideConnectConfigPointer,
	provideConnectConfig,
	provideConnectServiceNames,
	provideAllConnectHandlers,
	invokeServer,
)
View Source
var WithOtelConnectInterceptor = func(trustRemote bool, omitTraceEvents bool) fx.Option {
	var opts []otelconnect.Option

	if trustRemote {
		opts = append(opts, otelconnect.WithTrustRemote())
	}

	if omitTraceEvents {
		opts = append(opts, otelconnect.WithoutTraceEvents())
	}

	return fx.Provide(
		fx.Annotate(
			func() (connect.HandlerOption, error) {
				otelInterceptor, err := otelconnect.NewInterceptor(opts...)
				if err != nil {
					return nil, err
				}
				return connect.WithInterceptors(otelInterceptor), nil
			},
			fx.ResultTags(fxtags.Group(connectrpco.GroupConnectHandlerOptions)),
		),
	)
}

Functions

func NewConnectServer

func NewConnectServer(
	config connectrpco.ConnectConfig,
	connectHandlers []httpo.HttpPatternHandler,
	httpMiddleware []httpo.HttpMiddleware,
	log fx.Printer,
	lifecycle fx.Lifecycle,
) error

func SupplyConnectHandler

func SupplyConnectHandler(fn func(opts ...connect.HandlerOption) (string, http.Handler)) fx.Option

func SupplyConnectHandlerOptions

func SupplyConnectHandlerOptions(opts ...connect.HandlerOption) fx.Option

func SupplyHttpMiddleware

func SupplyHttpMiddleware(middleware ...httpo.HttpMiddleware) fx.Option

Types

This section is empty.

Jump to

Keyboard shortcuts

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