2025-03-07 14:10:15 +04:00
|
|
|
//go:generate go build -o analyzer.wasm -buildmode=c-shared analyzer.go
|
|
|
|
|
//go:build wasip1
|
2022-06-15 15:23:00 +03:00
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/aquasecurity/trivy/pkg/module/serialize"
|
|
|
|
|
"github.com/aquasecurity/trivy/pkg/module/wasm"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
moduleVersion = 1
|
|
|
|
|
moduleName = "analyzer"
|
|
|
|
|
)
|
|
|
|
|
|
2025-03-07 14:10:15 +04:00
|
|
|
func main() {}
|
|
|
|
|
|
2025-03-05 10:40:42 +04:00
|
|
|
func init() {
|
2022-06-15 15:23:00 +03:00
|
|
|
wasm.RegisterModule(AnalyzerModule{})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type AnalyzerModule struct{}
|
|
|
|
|
|
|
|
|
|
func (AnalyzerModule) Version() int {
|
|
|
|
|
return moduleVersion
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (AnalyzerModule) Name() string {
|
|
|
|
|
return moduleName
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (AnalyzerModule) RequiredFiles() []string {
|
|
|
|
|
return []string{
|
|
|
|
|
`foo(.?)`,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s AnalyzerModule) Analyze(_ string) (*serialize.AnalysisResult, error) {
|
|
|
|
|
return nil, nil
|
|
|
|
|
}
|