Versions in this module Expand all Collapse all v0 v0.24.3 Jun 16, 2023 Changes in this version + var Any = &Type + var Arm = &Type + var Auto = &Type + var CloudFormation = &Type + var CloudScan = &Type + var ErrFailedToFetchCloudState = errors.New("failed to fetch cloud state") + var FailedToParseInput = errors.New("Failed to parse input") + var InvalidInput = errors.New("Invalid input for input type") + var Kubernetes = &Type + var SupportedInputTypes = Types + var Terraform = &Type + var TerraformHCL = &Type + var TerraformPlan = &Type + var TerraformState = &Type + var UnableToReadDir = errors.New("Unable to read directory") + var UnableToReadFile = errors.New("Unable to read file") + var UnableToResolveLocation = errors.New("Unable to resolve location") + var UnrecognizedFileExtension = errors.New("Unrecognized file extension") + var UnsupportedInputType = errors.New("Unsupported input type") + type ArmDetector struct + func (c *ArmDetector) DetectDirectory(i *Directory, opts DetectOptions) (IACConfiguration, error) + func (c *ArmDetector) DetectFile(i *File, opts DetectOptions) (IACConfiguration, error) + type CfnDetector struct + func (c *CfnDetector) DetectDirectory(i *Directory, opts DetectOptions) (IACConfiguration, error) + func (c *CfnDetector) DetectFile(i *File, opts DetectOptions) (IACConfiguration, error) + type CloudClient interface + Resources func(ctx context.Context, orgID string, params cloudapi.ResourcesParameters) ([]cloudapi.ResourceObject, error) + type CloudLoader struct + Client CloudClient + func (l *CloudLoader) GetState(ctx context.Context, orgID string, params cloudapi.ResourcesParameters) (*models.State, error) + type DetectOptions struct + IgnoreExt bool + VarFiles []string + type Detectable interface + DetectType func(d Detector, opts DetectOptions) (IACConfiguration, error) + GetPath func() string + func NewDetectable(fs afero.Fs, path string) (Detectable, error) + type Detector interface + DetectDirectory func(i *Directory, opts DetectOptions) (IACConfiguration, error) + DetectFile func(i *File, opts DetectOptions) (IACConfiguration, error) + func DetectorByInputTypes(inputTypes Types) (Detector, error) + type Directory struct + Fs afero.Fs + Path string + func (d *Directory) Children() ([]Detectable, error) + func (d *Directory) DetectType(c Detector, opts DetectOptions) (IACConfiguration, error) + func (d *Directory) GetPath() string + func (d *Directory) Walk(w WalkFunc) error + type File struct + Fs afero.Fs + Path string + func (f *File) Contents() ([]byte, error) + func (f *File) DetectType(d Detector, opts DetectOptions) (IACConfiguration, error) + func (f *File) Ext() string + func (f *File) GetPath() string + type HclConfiguration struct + func (c *HclConfiguration) Errors() []error + func (c *HclConfiguration) LoadedFiles() []string + func (c *HclConfiguration) Location(path []interface{}) (LocationStack, error) + func (c *HclConfiguration) ToState() models.State + func (l *HclConfiguration) Type() *Type + type IACConfiguration interface + Errors func() []error + LoadedFiles func() []string + Location func(attributePath []interface{}) (LocationStack, error) + ToState func() models.State + Type func() *Type + type KubernetesDetector struct + func (c *KubernetesDetector) DetectDirectory(i *Directory, opts DetectOptions) (IACConfiguration, error) + func (c *KubernetesDetector) DetectFile(i *File, opts DetectOptions) (IACConfiguration, error) + type Loader struct + func NewLoader(detector Detector) Loader + func (l *Loader) Count() int + func (l *Loader) Errors() map[string][]error + func (l *Loader) Load(detectable Detectable, detectOpts DetectOptions) (bool, error) + func (l *Loader) Location(path string, attributePath []interface{}) (LocationStack, error) + func (l *Loader) ToStates() []models.State + type Location struct + Col int + Line int + Path string + func (l Location) String() string + type LocationStack = []Location + type MultiDetector struct + func NewMultiDetector(detectors ...Detector) *MultiDetector + func (a *MultiDetector) DetectDirectory(i *Directory, opts DetectOptions) (IACConfiguration, error) + func (a *MultiDetector) DetectFile(i *File, opts DetectOptions) (IACConfiguration, error) + type SourceInfoNode struct + func LoadMultiSourceInfoNode(contents []byte) ([]SourceInfoNode, error) + func LoadSourceInfoNode(contents []byte) (*SourceInfoNode, error) + func (node *SourceInfoNode) GetIndex(index int) (*SourceInfoNode, error) + func (node *SourceInfoNode) GetKey(key string) (*SourceInfoNode, error) + func (node *SourceInfoNode) GetPath(path []interface{}) (*SourceInfoNode, error) + func (node *SourceInfoNode) Location() (int, int) + type TfDetector struct + func (t *TfDetector) DetectDirectory(i *Directory, opts DetectOptions) (IACConfiguration, error) + func (t *TfDetector) DetectFile(i *File, opts DetectOptions) (IACConfiguration, error) + type TfPlanDetector struct + func (t *TfPlanDetector) DetectDirectory(i *Directory, opts DetectOptions) (IACConfiguration, error) + func (t *TfPlanDetector) DetectFile(i *File, opts DetectOptions) (IACConfiguration, error) + type TfStateDetector struct + func (t *TfStateDetector) DetectDirectory(i *Directory, opts DetectOptions) (IACConfiguration, error) + func (t *TfStateDetector) DetectFile(i *File, opts DetectOptions) (IACConfiguration, error) + type Type struct + Aliases []string + Children Types + Name string + func (t *Type) Equals(other *Type) bool + func (t *Type) Matches(inputType string) bool + type Types []*Type + func (t Types) Equals(other Types) bool + func (t Types) FromString(inputType string) (*Type, error) + type WalkFunc func(d Detectable, depth int) (skip bool, err error)