pipeparser

package
v0.1.0-beta.202310060640 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalWorkspaceProfile *modconfig.WorkspaceProfile

Functions

func BootstrapViper

func BootstrapViper(loader *WorkspaceProfileLoader, cmd *cobra.Command) error

BootstrapViper sets up viper with the essential path config (workspace-chdir and install-dir)

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 IsCloudWorkspaceIdentifier

func IsCloudWorkspaceIdentifier(name string) bool

IsCloudWorkspaceIdentifier returns whether name is a cloud workspace identifier of the form: {identity_handle}/{workspace_handle},

func LoadMod

func LoadMod(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(mod *modconfig.Mod, parseCtx *parse.ModParseContext) (resources *modconfig.WorkspaceResources, err error)

LoadModResourceNames parses all hcl files in modPath and returns the names of all resources

func LoadModWithFileName

func LoadModWithFileName(modPath string, 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 LoadVariableDefinitions

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

func ModFileExists

func ModFileExists(modPath, modFile string) bool

func SetDefaultFromEnv

func SetDefaultFromEnv(k string, configVar string, varType cmdconfig.EnvVarType)

func SetDefaultsFromConfig

func SetDefaultsFromConfig(configMap map[string]interface{})

SetDefaultsFromConfig overrides viper default values from hcl config values

func SetDefaultsFromEnv

func SetDefaultsFromEnv()

set default values from env vars

func ToError

func ToError(val interface{}) error

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

func Viper

func Viper() *viper.Viper

Viper fetches the global viper instance

Types

type DependencyPathKey

type DependencyPathKey string

DependencyPathKey is a string representation of a dependency path

  • a set of mod dependencyPath values separated by '->'

e.g. local -> github.com/kaidaguerre/steampipe-mod-m1@v3.1.1 -> github.com/kaidaguerre/steampipe-mod-m2@v5.1.1

func (DependencyPathKey) GetParent

func (k DependencyPathKey) GetParent() DependencyPathKey

func (DependencyPathKey) PathLength

func (k DependencyPathKey) PathLength() int

how long is the depdency path

type MissingVariableError

type MissingVariableError struct {
	MissingVariables           []*modconfig.Variable
	MissingTransitiveVariables map[DependencyPathKey][]*modconfig.Variable
	// contains filtered or unexported fields
}

func NewMissingVarsError

func NewMissingVarsError(workspaceMod *modconfig.Mod) MissingVariableError

func (MissingVariableError) Error

func (m MissingVariableError) Error() string

type ParseModFlag

type ParseModFlag uint32
const (
	CreateDefaultMod ParseModFlag = 1 << iota
	CreatePseudoResources
)

type PluginRemoveReport

type PluginRemoveReport struct {
	Image       *ociinstaller.SteampipeImageRef
	ShortName   string
	Connections []*modconfig.Connection
}

type PluginRemoveReports

type PluginRemoveReports []PluginRemoveReport

func (PluginRemoveReports) Print

func (r PluginRemoveReports) Print()

type ReferenceTypeValueMap

type ReferenceTypeValueMap map[string]map[string]cty.Value
ReferenceTypeValueMap is the raw data used to build the evaluation context

When resolving hcl references like : - query.q1 - var.v1 - mod1.query.my_query.sql

ReferenceTypeValueMap is keyed by resource type, then by resource name

type VariableValidationFailedError

type VariableValidationFailedError struct {
	// contains filtered or unexported fields
}

func (VariableValidationFailedError) Error

type WorkspaceProfileLoader

type WorkspaceProfileLoader struct {
	DefaultProfile    *modconfig.WorkspaceProfile
	ConfiguredProfile *modconfig.WorkspaceProfile
	// contains filtered or unexported fields
}

func LoadWorkspaceProfile

func LoadWorkspaceProfile(runCtx context.Context) (*WorkspaceProfileLoader, error)

func NewWorkspaceProfileLoader

func NewWorkspaceProfileLoader(runCtx context.Context, workspaceProfilePath string) (*WorkspaceProfileLoader, error)

func (*WorkspaceProfileLoader) GetActiveWorkspaceProfile

func (l *WorkspaceProfileLoader) GetActiveWorkspaceProfile() *modconfig.WorkspaceProfile

Directories

Path Synopsis
Package version :: The version package provides a location to set the release versions for all packages to consume, without creating import cycles.
Package version :: The version package provides a location to set the release versions for all packages to consume, without creating import cycles.

Jump to

Keyboard shortcuts

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