fix(go): repair migration wire contracts and runtime lifecycle; document incomplete port
This commit is contained in:
1 parent
e43a310617
commit
32e47014b5
35 files changed
+16826
-438
No files matched your search
@@ -27,6 +27,13 @@ var (
|
||||
isRegistryLoaded bool
|
||||
)
|
||||
|
||||
func init() {
|
||||
for name, id := range canonicalMethodIDs {
|
||||
nameToIdMap[name] = id
|
||||
idToNameMap[id] = name
|
||||
}
|
||||
}
|
||||
|
||||
// LoadMethodCatalog loads the method catalog from a JSON file (e.g. data/client_data/MethodIds.json).
|
||||
func LoadMethodCatalog(path string) error {
|
||||
data, err := os.ReadFile(path)
|
||||
@@ -72,10 +79,11 @@ func GetMethodID(name string) (uint32, bool) {
|
||||
return id, ok
|
||||
}
|
||||
|
||||
// MethodGetMethodIDDefault returns the numeric ID for a method name or a fallback.
|
||||
// MethodGetMethodIDDefault resolves a verified name. Legacy callers still pass
|
||||
// a fallback, but guessed IDs must never be sent to an unrelated client handler.
|
||||
func MethodGetMethodIDDefault(name string, fallback uint32) uint32 {
|
||||
if id, ok := GetMethodID(name); ok {
|
||||
return id
|
||||
}
|
||||
return fallback
|
||||
return 0
|
||||
}
|
||||
Reference in new issue
Block a user