MCPcopy Index your code
hub / github.com/keploy/keploy / isValidGRPCIdentifier

Function isValidGRPCIdentifier

utils/utils.go:1618–1638  ·  view source on GitHub ↗

isValidGRPCIdentifier validates if a string is a valid gRPC identifier gRPC identifiers must start with a letter and contain only letters, digits, and underscores

(name string)

Source from the content-addressed store, hash-verified

1616// isValidGRPCIdentifier validates if a string is a valid gRPC identifier
1617// gRPC identifiers must start with a letter and contain only letters, digits, and underscores
1618func isValidGRPCIdentifier(name string) bool {
1619 if len(name) == 0 {
1620 return false
1621 }
1622
1623 // First character must be a letter or underscore
1624 first := name[0]
1625 if !((first >= 'a' && first <= 'z') || (first >= 'A' && first <= 'Z') || first == '_') {
1626 return false
1627 }
1628
1629 // Remaining characters must be letters, digits, or underscores
1630 for i := 1; i < len(name); i++ {
1631 c := name[i]
1632 if !((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_') {
1633 return false
1634 }
1635 }
1636
1637 return true
1638}
1639
1640func GetContainerIPv4() (string, error) {
1641 // Get all network interfaces

Callers 1

ParseGRPCPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected