Documentation

Overview

Package extendonlyfx provides better integration for Fx for services implementing or calling ExtendOnly.

Clients

If you are making requests to ExtendOnly, use the Client function to inject a ExtendOnly client into your container.

fx.Provide(extendonlyfx.Client("..."))

Servers

If you are implementing ExtendOnly, provide a extendonlyserver.Interface into the container and use the Server function.

Given,

func NewExtendOnlyHandler() extendonlyserver.Interface

You can do the following to have the procedures of ExtendOnly made available to an Fx application.

fx.Provide(
	NewExtendOnlyHandler,
	extendonlyfx.Server(),
)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client(name string, opts ...thrift.ClientOption) interface{}

Client provides a ExtendOnly client to an Fx application using the given name for routing.

fx.Provide(
	extendonlyfx.Client("..."),
	newHandler,
)

func Server

func Server(opts ...thrift.RegisterOption) interface{}

Server provides procedures for ExtendOnly to an Fx application. It expects a extendonlyfx.Interface to be present in the container.

fx.Provide(
	func(h *MyExtendOnlyHandler) extendonlyserver.Interface {
		return h
	},
	extendonlyfx.Server(),
)

Types

type Params

type Params struct {
	fx.In

	Provider yarpc.ClientConfig
}

Params defines the dependencies for the ExtendOnly client.

type Result

type Result struct {
	fx.Out

	Client extendonlyclient.Interface
}

Result defines the output of the ExtendOnly client module. It provides a ExtendOnly client to an Fx application.

type ServerParams

type ServerParams struct {
	fx.In

	Handler extendonlyserver.Interface
}

ServerParams defines the dependencies for the ExtendOnly server.

type ServerResult

type ServerResult struct {
	fx.Out

	Procedures []transport.Procedure `group:"yarpcfx"`
}

ServerResult defines the output of ExtendOnly server module. It provides the procedures of a ExtendOnly handler to an Fx application.

The procedures are provided to the "yarpcfx" value group. Dig 1.2 or newer must be used for this feature to work.