Documentation
¶
Index ¶
- func CheckContentHash(expectedHash, content string) bool
- func SHA256(content string) string
- func ValidateConfigFile(config ConfigFile) error
- type ConfigFile
- type FileReport
- type Finding
- type Fn
- type FnType
- type Ignore
- type IncludeRaw
- type RawConfig
- type RawFn
- func (f RawFn) CacheDirWASM() (string, error)
- func (f RawFn) CheckWASMHash(content []byte, hash string) bool
- func (f RawFn) GetMetadataHash() (string, error)
- func (f RawFn) GetWASMFromCache(hash string) ([]byte, error)
- func (f RawFn) GetWASMFromPath(path string) ([]byte, error)
- func (f RawFn) GetWASMFromUrl(url string) ([]byte, error)
- func (f RawFn) WriteWASMToCache(content []byte) (bool, error)
- type RawRule
- type Rule
- type RuleFunc
- func BuildFileFnBuiltin(f RawFn) RuleFunc
- func BuildFileFnJs(f RawFn) RuleFunc
- func BuildFileScopeFn(f RawFn) RuleFunc
- func BuildFn(f RawFn) RuleFunc
- func BuildLineFn(f RawFn) RuleFunc
- func BuildPathFnBuiltin(f RawFn) RuleFunc
- func BuildPathFnJs(f RawFn) RuleFunc
- func BuildPathScopeFn(f RawFn) RuleFunc
- type RuleFuncArgs
- type RuleFuncResult
- type Scope
- type SeverityLevel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckContentHash ¶
func ValidateConfigFile ¶
func ValidateConfigFile(config ConfigFile) error
Types ¶
type ConfigFile ¶
func LoadConfigFile ¶
func LoadConfigFile(content string) (ConfigFile, error)
type FileReport ¶
func ProcessFile ¶
func ProcessFile(content string, path string, cfg ConfigFile) (FileReport, error)
type IncludeRaw ¶
type RawConfig ¶
type RawConfig struct { Version string Includes []IncludeRaw Rules []RawRule }
type RawFn ¶
type RawFn struct { Type string Scope Scope Name string Args []any Body string // sha256: sha256 hash in hex form Metadata map[string]any }
func (RawFn) CacheDirWASM ¶ added in v0.0.5
func (RawFn) CheckWASMHash ¶ added in v0.0.5
func (RawFn) GetMetadataHash ¶ added in v0.0.5
func (RawFn) GetWASMFromCache ¶ added in v0.0.5
func (RawFn) GetWASMFromPath ¶ added in v0.0.5
func (RawFn) GetWASMFromUrl ¶ added in v0.0.5
type Rule ¶
type Rule struct { Fn RuleFunc Id string Description string Recommendation string Severity SeverityLevel // Link to the documentation for this Rule Link string // FilenameRegex is the regexp used to determine if this Rule should run on a given file IncludePaths *regexp.Regexp ExcludePaths *regexp.Regexp Scope Scope }
type RuleFunc ¶
func BuildFileFnBuiltin ¶
func BuildFileFnJs ¶
func BuildFileScopeFn ¶
func BuildLineFn ¶
func BuildPathFnBuiltin ¶
func BuildPathFnJs ¶
func BuildPathScopeFn ¶
type RuleFuncArgs ¶ added in v0.0.5
type RuleFuncArgs [3]interface{}
type RuleFuncResult ¶ added in v0.0.5
type RuleFuncResult struct {
Value bool
}
type SeverityLevel ¶
type SeverityLevel int
Click to show internal directories.
Click to hide internal directories.