configprovider

package
v0.0.0-...-bcbb5c0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2018 License: Apache-2.0 Imports: 2 Imported by: 4

Documentation

Overview

Package configprovider provides a simple interface to implement configuration providers for action modules and event sources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterConfigProvider

func RegisterConfigProvider(name string, provider ConfigProviderInterface)

RegisterConfigProvider registers a config provider. Must be called from the init() of the configprovider.

Types

type ConfigProviderInterface

type ConfigProviderInterface interface {
	GetEventSourceConfig(eventsource string) ([]byte, error)
	GetActionModuleConfig(actionmodule string) ([]byte, error)
	Setup(config map[string]interface{}) error
}

ConfigProviderInterface is the interface of configuration providers. Setup() is called when CSF starts and can be used to configure the configuration provider. \o/ GetEventSourceConfig() should return the configuration of the given event source and GetActionModuleConfig() should returns the configuration of the given action module.

func GetConfigProvider

func GetConfigProvider(name string) (ConfigProviderInterface, error)

GetConfigProvider returns a configprovider by its name.

Jump to

Keyboard shortcuts

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