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

Function determineSchemaType

pkg/schema/loader.go:50–62  ·  view source on GitHub ↗

End LoadSchema determineSchemaType determines the type of schema based on the input string

(input string)

Source from the content-addressed store, hash-verified

48} // End LoadSchema
49// determineSchemaType determines the type of schema based on the input string
50func determineSchemaType(input string) (Type, error) {
51 if isURL(input) { // Check URL first
52 return URL, nil // Return URL type
53 } // Not URL
54 valid, err := isFilePath(input) // Check if file path
55 if err != nil {
56 return Inline, nil
57 }
58 if valid {
59 return File, nil
60 }
61 return Inline, nil // Default to inline
62} // End determineSchemaType
63func isURL(input string) bool { // Check if input is URL
64 parsedURL, err := url.Parse(input)
65 if err != nil {

Callers 2

loader_test.goFile · 0.85
LoadSchemaMethod · 0.85

Calls 2

isURLFunction · 0.85
isFilePathFunction · 0.85

Tested by

no test coverage detected