MCPcopy Create free account
hub / github.com/encodeous/nylon / WriteConfig

Method WriteConfig

e2e/harness.go:516–526  ·  view source on GitHub ↗

WriteConfig marshals the config to YAML and writes it to the specified directory with the given filename

(dir, filename string, cfg any)

Source from the content-addressed store, hash-verified

514
515// WriteConfig marshals the config to YAML and writes it to the specified directory with the given filename
516func (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
529func SimpleRouter(id string, pubKey state.NyPublicKey, nylonIP string, endpointIP string) state.RouterCfg {

Callers 10

TestRecoveryExampleFunction · 0.95
TestJSONLoggingFunction · 0.95
TestConnectivityFunction · 0.95
TestDistributionFunction · 0.95
TestHealthcheckPingFunction · 0.95
TestHealthcheckHTTPFunction · 0.95
TestEndpointResolutionFunction · 0.95
TestDynamicResolutionFunction · 0.95

Calls

no outgoing calls

Tested by 10

TestRecoveryExampleFunction · 0.76
TestJSONLoggingFunction · 0.76
TestConnectivityFunction · 0.76
TestDistributionFunction · 0.76
TestHealthcheckPingFunction · 0.76
TestHealthcheckHTTPFunction · 0.76
TestEndpointResolutionFunction · 0.76
TestDynamicResolutionFunction · 0.76