MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / homeModelInt64Value

Function homeModelInt64Value

internal/api/server.go:1406–1426  ·  view source on GitHub ↗
(model map[string]any, keys ...string)

Source from the content-addressed store, hash-verified

1404}
1405
1406func homeModelInt64Value(model map[string]any, keys ...string) int64 {
1407 for _, key := range keys {
1408 switch value := model[key].(type) {
1409 case float64:
1410 return int64(value)
1411 case int64:
1412 return value
1413 case int:
1414 return int64(value)
1415 case json.Number:
1416 if n, errInt := value.Int64(); errInt == nil {
1417 return n
1418 }
1419 case string:
1420 if n, errParse := strconv.ParseInt(strings.TrimSpace(value), 10, 64); errParse == nil {
1421 return n
1422 }
1423 }
1424 }
1425 return 0
1426}
1427
1428// Start begins listening for and serving HTTP or HTTPS requests.
1429// It's a blocking call and will only return on an unrecoverable error.

Callers 1

decodeHomeModelsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected