flavors

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2017 License: Apache-2.0 Imports: 0 Imported by: 0

README

Flavors

A flavor is a reusable collection of plugins. It allows inspecting capabilities available to an agent. By convention, a Flavor should provide:

  • a method called Inject(), which should wire the flavor's plugins together and to their external dependencies (typically via dependency injection.
  • a method called Plugins(), which should return all plugins contained in the Flavor, including plugins contained in reused Flavors.

Example:

type MyFlavor struct {
	injected     bool
	Aplugin      a.Plugin
	Bplugin      b.Plugin
	Cplugin      c.Plugin
}

func (f *MyFlavor) Inject() bool {
	if f.injected {
		return false
	}
	f.injected = true
	f.Bplugin.A = &f.Aplugin
	f.Cplugin.B = &f.Bplugin
	return true
}

func (f *MyFlavor) Plugins() []*core.NamedPlugin {
	f.Inject()
	return core.ListPluginsInFlavor(f)
}

Documentation

Overview

Package flavors contains predefined vpp-agent flavors.

Directories

Path Synopsis
Package local defines flavor used for VPP agents managed only locally.
Package local defines flavor used for VPP agents managed only locally.
rpc
Package rpc defines flavor used for VPP agents managed using GPRC service.
Package rpc defines flavor used for VPP agents managed using GPRC service.
model
Package model is the parent for packages defining various GRPC services generated from protobuf data models.
Package model is the parent for packages defining various GRPC services generated from protobuf data models.
model/vppsvc
Package vppsvc is a generated protocol buffer package.
Package vppsvc is a generated protocol buffer package.
Package vpp defines the standard flavor used for full-featured VPP agents.
Package vpp defines the standard flavor used for full-featured VPP agents.

Jump to

Keyboard shortcuts

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