Documentation ¶
Overview ¶
Package emptyservicefx provides better integration for Fx for services implementing or calling EmptyService.
Clients ¶
If you are making requests to EmptyService, use the Client function to inject a EmptyService client into your container.
fx.Provide(emptyservicefx.Client("..."))
Servers ¶
If you are implementing EmptyService, provide a emptyserviceserver.Interface into the container and use the Server function.
Given,
func NewEmptyServiceHandler() emptyserviceserver.Interface
You can do the following to have the procedures of EmptyService made available to an Fx application.
fx.Provide( NewEmptyServiceHandler, emptyservicefx.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 EmptyService client to an Fx application using the given name for routing.
fx.Provide( emptyservicefx.Client("..."), newHandler, )
func Server ¶
func Server(opts ...thrift.RegisterOption) interface{}
Server provides procedures for EmptyService to an Fx application. It expects a emptyservicefx.Interface to be present in the container.
fx.Provide( func(h *MyEmptyServiceHandler) emptyserviceserver.Interface { return h }, emptyservicefx.Server(), )
Types ¶
type Params ¶
type Params struct { fx.In Provider yarpc.ClientConfig }
Params defines the dependencies for the EmptyService client.
type Result ¶
type Result struct { fx.Out Client emptyserviceclient.Interface }
Result defines the output of the EmptyService client module. It provides a EmptyService client to an Fx application.
type ServerParams ¶
type ServerParams struct { fx.In Handler emptyserviceserver.Interface }
ServerParams defines the dependencies for the EmptyService server.
type ServerResult ¶
ServerResult defines the output of EmptyService server module. It provides the procedures of a EmptyService 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.