MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / Save

Method Save

internal/waf/waf.go:359–371  ·  view source on GitHub ↗

Save to file path

(path string)

Source from the content-addressed store, hash-verified

357
358// Save to file path
359func (this *WAF) Save(path string) error {
360 if len(path) == 0 {
361 return errors.New("path should not be empty")
362 }
363 if len(this.CreatedVersion) == 0 {
364 this.CreatedVersion = teaconst.Version
365 }
366 data, err := yaml.Marshal(this)
367 if err != nil {
368 return err
369 }
370 return os.WriteFile(path, data, 0644)
371}
372
373func (this *WAF) ContainsGroupCode(code string) bool {
374 if len(code) == 0 {

Callers 2

syncConfigMethod · 0.45
TestIPList_SaveFunction · 0.45

Calls 1

WriteFileMethod · 0.80

Tested by 1

TestIPList_SaveFunction · 0.36