WriteConfig marshals the config to YAML and writes it to the specified directory with the given filename
(dir, filename string, cfg any)
| 514 | |
| 515 | // WriteConfig marshals the config to YAML and writes it to the specified directory with the given filename |
| 516 | func (h *Harness) WriteConfig(dir, filename string, cfg any) string { |
| 517 | path := filepath.Join(dir, filename) |
| 518 | data, err := yaml.Marshal(cfg) |
| 519 | if err != nil { |
| 520 | h.t.Fatal(err) |
| 521 | } |
| 522 | if err := os.WriteFile(path, data, 0644); err != nil { |
| 523 | h.t.Fatal(err) |
| 524 | } |
| 525 | return path |
| 526 | } |
| 527 | |
| 528 | // SimpleRouter creates a basic RouterCfg with the given parameters |
| 529 | func SimpleRouter(id string, pubKey state.NyPublicKey, nylonIP string, endpointIP string) state.RouterCfg { |
no outgoing calls