github.com/khulnasoft-lab/defsec@v1.0.5-0.20230827010352-5e9f46893d95/pkg/scanners/terraform/parser/resolvers/options.go (about)

     1  package resolvers
     2  
     3  import (
     4  	"strings"
     5  
     6  	"github.com/khulnasoft-lab/defsec/pkg/debug"
     7  )
     8  
     9  type Options struct {
    10  	Source, OriginalSource, Version, OriginalVersion, WorkingDir, Name, ModulePath string
    11  	DebugLogger                                                                    debug.Logger
    12  	AllowDownloads                                                                 bool
    13  	AllowCache                                                                     bool
    14  	RelativePath                                                                   string
    15  }
    16  
    17  func (o *Options) hasPrefix(prefixes ...string) bool {
    18  	for _, prefix := range prefixes {
    19  		if strings.HasPrefix(o.Source, prefix) {
    20  			return true
    21  		}
    22  	}
    23  	return false
    24  }
    25  
    26  func (o *Options) Debug(format string, args ...interface{}) {
    27  	o.DebugLogger.Log(format, args...)
    28  }