first commit

This commit is contained in:
Ar1ste1a
2025-05-14 22:00:38 -04:00
commit a4dffe61bf
27 changed files with 4742 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
package files
type FileType int32
const (
JSON FileType = iota
XML
YAML
TEXT
)
func GetFileType(filetype string) FileType {
switch filetype {
case "json":
return JSON
case "xml":
return XML
case "yaml":
return YAML
case "txt":
return TEXT
default:
return JSON
}
}
func (ft FileType) String() string {
switch ft {
case JSON:
return "json"
case XML:
return "xml"
case YAML:
return "yaml"
case TEXT:
return "txt"
default:
return "json"
}
}
func (ft FileType) Extension() string {
return "." + ft.String()
}