load_mod

package
v0.2.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetModFileExtensions

func GetModFileExtensions() []string

TODO KAI WHO USES THIS 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 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 if CreatePseudoResources flag is set, construct hcl resources for files with specific extensions 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 LoadModResourceNames

func LoadModResourceNames(ctx context.Context, mod *modconfig.Mod, parseCtx *parse.ModParseContext) (resources *modconfig.WorkspaceResources, err error)

TODO KAI WHO USES THIS? LoadModResourceNames parses all hcl files in modPath and returns the names of all resources

func LoadModWithFileName

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

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)

func LoadVariableDefinitions

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

func ModFileExists

func ModFileExists(modPath, modFile string) bool

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