factory

package
v0.0.0-...-89602ce Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearMconfigBuilders

func ClearMconfigBuilders(_ *testing.T)

ClearMconfigBuilders clears existing mconfig builders.

func CreateMconfig

func CreateMconfig(networkId string, gatewayId string) (*protos.GatewayConfigs, error)

CreateMconfig creates an mconfig by delegating to all builders that have been registered with the factory and append those results together. Note that the keys which builders return must be globally unique.

func RegisterMconfigBuilder

func RegisterMconfigBuilder(builder MconfigBuilder)

func RegisterMconfigBuilders

func RegisterMconfigBuilders(builders ...MconfigBuilder)

func SetClock

func SetClock(_ *testing.T, clock clock)

Types

type MconfigBuilder

type MconfigBuilder interface {
	// Build a partial mconfig for a gateway given a network and gateway ID.
	// For the mconfig streamer, the keys of the map returned by this builder
	// must be unique across the entire system or else the streamer policy will
	// error out, as we cannot coordinate "merging" configs across different
	// modules.
	Build(networkId string, gatewayId string) (map[string]proto.Message, error)
}

Jump to

Keyboard shortcuts

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