flavors

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2018 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.
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