load_mod

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetModFileExtensions

func GetModFileExtensions() []string

GetModFileExtensions returns list of all file extensions we care about this will be the mod data extension, plus any registered extensions registered in fileToResourceMap

func GetVariableValues

func GetVariableValues(parseCtx *parse.ModParseContext, variableMap *modconfig.ModVariableMap, validate bool) (*modconfig.ModVariableMap, error_helpers.ErrorAndWarnings)

func LoadMod

func LoadMod(ctx context.Context, modPath string, parseCtx *parse.ModParseContext) (mod *modconfig.Mod, errorsAndWarnings error_helpers.ErrorAndWarnings)

LoadMod parses all hcl files in modPath and returns a single mod NOTE: it is an error if there is more than 1 mod defined, however zero mods is acceptable - a default mod will be created assuming there are any resource files

func LoadModWithFileName

func LoadModWithFileName(ctx context.Context, modPath, modFile string, parseCtx *parse.ModParseContext) (mod *modconfig.Mod, errorsAndWarnings error_helpers.ErrorAndWarnings)

Deprecated TODO this function is included for backwards compatibility - it is used for Flowpipe LoadPipelines

func LoadPipelines

func LoadPipelines(ctx context.Context, configPath string) (map[string]*modconfig.Pipeline, map[string]*modconfig.Trigger, error)

Convenient function to support testing

The automated tests were initially created before the concept of Mod is introduced in Flowpipe

We can potentially remove this function, but we have to refactor all our test cases

func LoadPipelinesReturningItsMod

func LoadPipelinesReturningItsMod(ctx context.Context, configPath string) (*modconfig.Mod, error)

TODO update this to NOT use deprecated LoadModWithFileName

func LoadVariableDefinitions

func LoadVariableDefinitions(ctx context.Context, variablePath string, parseCtx *parse.ModParseContext) (*modconfig.ModVariableMap, error)

func ToError

func ToError(val interface{}) error

ToError formats the supplied value as an error (or just returns it if already an error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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