MCPcopy Create free account
hub / github.com/Permify/permify / isFilePath

Function isFilePath

pkg/schema/loader.go:71–83  ·  view source on GitHub ↗

End isURL

(input string)

Source from the content-addressed store, hash-verified

69 return parsedURL.Scheme != "" && parsedURL.Host != ""
70} // End isURL
71func isFilePath(input string) (bool, error) { // Check if input is file
72 _, err := os.Stat(input) // Get file info
73 if err != nil {
74 if os.IsNotExist(err) {
75 return false, errors.New("file does not exist")
76 }
77 if os.IsPermission(err) {
78 return false, errors.New("permission denied")
79 }
80 return false, err
81 }
82 return true, nil // File exists
83} // End isFilePath
84func loadFromURL(inputURL string) (string, error) { // Load schema from URL
85 // Parse and validate the URL
86 parsedURL, err := url.Parse(inputURL)

Callers 2

loader_test.goFile · 0.85
determineSchemaTypeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected