MCPcopy Create free account
hub / github.com/cloudwan/gohan / checkIfPathMatchesSyncKeyTemplate

Function checkIfPathMatchesSyncKeyTemplate

schema/schema.go:536–550  ·  view source on GitHub ↗
(path string, syncKeyTemplate string)

Source from the content-addressed store, hash-verified

534}
535
536func checkIfPathMatchesSyncKeyTemplate(path string, syncKeyTemplate string) bool {
537 syncKeyTemplateSplit := strings.Split(syncKeyTemplate, "/")
538 schemaPathSplit := strings.Split(path, "/")
539 if len(schemaPathSplit) == len(syncKeyTemplateSplit) {
540 for k, v := range syncKeyTemplateSplit {
541 if strings.HasPrefix(v, "{{") {
542 continue
543 } else if schemaPathSplit[k] != syncKeyTemplateSplit[k] {
544 return false
545 }
546 }
547 return true
548 }
549 return false
550}
551
552// FormatParentID ...
553func FormatParentID(parent string) string {

Callers 1

GetSchemaByPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected