rpc

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package rpc defines "RPC" flavor, which combines all plugins that provide RPC-like access.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAgent added in v1.0.7

func NewAgent(opts ...core.Option) *core.Agent

NewAgent returns a new instance of the Agent with plugins. It is an alias for core.NewAgent() to implicit use of the FlavorRPC

func WithPlugins added in v1.0.7

func WithPlugins(listPlugins func(local *FlavorRPC) []*core.NamedPlugin) core.WithPluginsOpt

WithPlugins for adding custom plugins to SFC Controller <listPlugins> is a callback that uses flavor input to inject dependencies for custom plugins that are in output

Example:

   NewAgent(rpc.WithPlugins(func(flavor) {
	       return []*core.NamedPlugin{{"my-plugin", &MyPlugin{DependencyXY: &flavor.GRPC}}}
   }))

Types

type FlavorRPC

type FlavorRPC struct {
	*local.FlavorLocal

	HTTP rest.Plugin
	//TODO GRPC (& enable/disable using config)
	HTTPProbe  rest.ForkPlugin
	Prometheus prometheus.Plugin

	HealthRPC     probe.Plugin
	PrometheusRPC probe.PrometheusPlugin

	GRPC grpc.Plugin
	// contains filtered or unexported fields
}

FlavorRPC glues together multiple plugins that provide RPC-like access. They are typically used to enable remote management for other plugins.

func (*FlavorRPC) Inject

func (f *FlavorRPC) Inject() bool

Inject initializes flavor references/dependencies.

func (*FlavorRPC) Plugins

func (f *FlavorRPC) Plugins() []*core.NamedPlugin

Plugins combines all Plugins in flavor to the list.

Jump to

Keyboard shortcuts

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