rpc

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: Apache-2.0 Imports: 20 Imported by: 6

Documentation

Overview

Package rpc provides an rpc service entry point.

The rpc package's constructor is expected to be passed to a bootstrapper instance in order to be autoconfigured. A fully configured instance is ready to be used as a go-micro service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewService

func NewService(
	engine RPCEngine,
	client client.Client,
	registry registry.Registry,
	broker messaging.BrokerWithOptions,
	cache cache.Cache,
	tracer *oteltrace.TracerProvider,
	rpcConfig *config.ServerConfig,
	resilienceConfig *config.ResilienceConfig,
	tracerConfig *config.TracerConfig,
) micro.Service

A micro.Service constructor. Called automatically by fx if provided to a bootstrapper instance.

Returns a fully configured and ready to use rpc based micro.Service. Panics on any error.

Types

type RPCEngine

type RPCEngine interface {
	BuildMessageHandlers() []RPCMessageHandler
	BuildHandlers() []interface{}
}

RPCEngine provides main ways of interactions with an rpc instance.

type RPCMessageHandler

type RPCMessageHandler struct {
	// Broker topic (queue).
	Topic string
	// Topic Handler according to go-micro spec.
	Handler interface{}
}

RPCMessageHandler a way to set up broker message handlers.

Jump to

Keyboard shortcuts

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