Save to file path
(path string)
| 357 | |
| 358 | // Save to file path |
| 359 | func (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 | |
| 373 | func (this *WAF) ContainsGroupCode(code string) bool { |
| 374 | if len(code) == 0 { |