github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/lang/define_getters.go (about) 1 package lang 2 3 import ( 4 "strings" 5 6 "github.com/lmorg/murex/lang/types" 7 ) 8 9 // GetExtType gets the murex data type for a corresponding file extension 10 func GetExtType(extension string) (dt string) { 11 dt = fileExts[strings.ToLower(extension)] 12 if dt == "" { 13 return types.Generic 14 } 15 return 16 } 17 18 // GetMimes returns MIME lookup table 19 func GetMimes() map[string]string { 20 return mimes 21 } 22 23 // ReadMimes returns an interface{} of mimes. 24 // This is only intended to be used by `config.Properties.GoFunc.Read()` 25 func ReadMimes() (interface{}, error) { 26 return mimes, nil 27 } 28 29 // GetFileExts returns the file extension lookup table 30 func GetFileExts() map[string]string { 31 return fileExts 32 } 33 34 // ReadFileExtensions returns an interface{} of fileExts. 35 // This is only intended to be used by `config.Properties.GoFunc.Read()` 36 func ReadFileExtensions() (interface{}, error) { 37 return fileExts, nil 38 }