mirror of
https://github.com/chainreactors/spray.git
synced 2026-10-24 17:04:26 +00:00
go generate with the updated templates submodule (7d5675c) produces different embedded data and code. Key changes: - cmd/cmd.go: logs.Info/Important → logs.InfoLevel/ImportantLevel - pkg/templates.go: remove proton_rules.bin/neutron.bin embeds (no longer needed) - core/baseline: use ProtonExtract instead of Extractors.Extract - core/format: list proton extractor names - Update embedded binary data files Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
42 lines
875 B
Go
42 lines
875 B
Go
//go:build !emptytemplates
|
|
// +build !emptytemplates
|
|
|
|
package pkg
|
|
|
|
import (
|
|
_ "embed"
|
|
|
|
"github.com/chainreactors/utils/encode"
|
|
)
|
|
|
|
//go:embed data/spray_rule.bin
|
|
var sprayRuleData []byte
|
|
|
|
//go:embed data/spray_common.bin
|
|
var sprayCommonData []byte
|
|
|
|
//go:embed data/spray_dict.bin
|
|
var sprayDictData []byte
|
|
|
|
//go:embed data/extract.bin
|
|
var extractData []byte
|
|
|
|
//go:embed data/port.bin
|
|
var portData []byte
|
|
|
|
|
|
func loadEmbeddedConfig(typ string) []byte {
|
|
if typ == "spray_rule" {
|
|
return encode.MustDeflateDeCompress(sprayRuleData)
|
|
}else if typ == "spray_common" {
|
|
return encode.MustDeflateDeCompress(sprayCommonData)
|
|
}else if typ == "spray_dict" {
|
|
return encode.MustDeflateDeCompress(sprayDictData)
|
|
}else if typ == "extract" {
|
|
return encode.MustDeflateDeCompress(extractData)
|
|
}else if typ == "port" {
|
|
return encode.MustDeflateDeCompress(portData)
|
|
}
|
|
return nil
|
|
}
|