workflowservicefx

package
v0.0.0-...-93c17bf Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package workflowservicefx provides better integration for Fx for services implementing or calling WorkflowService.

Clients

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

fx.Provide(workflowservicefx.Client("..."))

Servers

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

Given,

func NewWorkflowServiceHandler() workflowserviceserver.Interface

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

fx.Provide(
	NewWorkflowServiceHandler,
	workflowservicefx.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 WorkflowService client to an Fx application using the given name for routing.

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

func Server

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

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

fx.Provide(
	func(h *MyWorkflowServiceHandler) workflowserviceserver.Interface {
		return h
	},
	workflowservicefx.Server(),
)

Types

type Params

type Params struct {
	fx.In

	Provider yarpc.ClientConfig
}

Params defines the dependencies for the WorkflowService client.

type Result

type Result struct {
	fx.Out

	Client workflowserviceclient.Interface
}

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

type ServerParams

type ServerParams struct {
	fx.In

	Handler workflowserviceserver.Interface
}

ServerParams defines the dependencies for the WorkflowService server.

type ServerResult

type ServerResult struct {
	fx.Out

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

ServerResult defines the output of WorkflowService server module. It provides the procedures of a WorkflowService 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.

Jump to

Keyboard shortcuts

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