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

Function SimpleRouter

e2e/harness.go:529–545  ·  view source on GitHub ↗

SimpleRouter creates a basic RouterCfg with the given parameters

(id string, pubKey state.NyPublicKey, nylonIP string, endpointIP string)

Source from the content-addressed store, hash-verified

527
528// SimpleRouter creates a basic RouterCfg with the given parameters
529func SimpleRouter(id string, pubKey state.NyPublicKey, nylonIP string, endpointIP string) state.RouterCfg {
530 cfg := state.RouterCfg{
531 NodeCfg: state.NodeCfg{
532 Id: state.NodeId(id),
533 PubKey: pubKey,
534 Addresses: []netip.Addr{
535 netip.MustParseAddr(nylonIP),
536 },
537 },
538 }
539 if endpointIP != "" {
540 cfg.Endpoints = []*state.DynamicEndpoint{
541 state.NewDynamicEndpoint(fmt.Sprintf("%s:57175", endpointIP)),
542 }
543 }
544 return cfg
545}
546
547// SimpleLocal creates a basic LocalCfg with the given parameters and defaults
548func SimpleLocal(id string, key state.NyPrivateKey) state.LocalCfg {

Callers 9

TestRecoveryExampleFunction · 0.85
TestJSONLoggingFunction · 0.85
TestConnectivityFunction · 0.85
TestDistributionFunction · 0.85
TestHealthcheckPingFunction · 0.85
TestHealthcheckHTTPFunction · 0.85

Calls 2

NodeIdTypeAlias · 0.92
NewDynamicEndpointFunction · 0.92

Tested by 9

TestRecoveryExampleFunction · 0.68
TestJSONLoggingFunction · 0.68
TestConnectivityFunction · 0.68
TestDistributionFunction · 0.68
TestHealthcheckPingFunction · 0.68
TestHealthcheckHTTPFunction · 0.68