2021-02-21 10:02:42 -05:00
|
|
|
package mergers
|
|
|
|
|
|
|
|
import "strings"
|
|
|
|
|
|
|
|
// GetExtensions get extensions of given format
|
|
|
|
func GetExtensions(formatName string) ([]string, error) {
|
|
|
|
lowerName := strings.ToLower(formatName)
|
|
|
|
if lowerName == "auto" {
|
|
|
|
return GetAllExtensions(), nil
|
|
|
|
}
|
2021-03-10 16:03:26 -05:00
|
|
|
f, found := mergersByName[lowerName]
|
2021-02-21 10:02:42 -05:00
|
|
|
if !found {
|
|
|
|
return nil, newError(formatName+" not found", formatName).AtWarning()
|
|
|
|
}
|
|
|
|
return f.Extensions, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetAllExtensions get all extensions supported
|
|
|
|
func GetAllExtensions() []string {
|
|
|
|
extensions := make([]string, 0)
|
2021-03-10 16:03:26 -05:00
|
|
|
for _, f := range mergersByName {
|
2021-02-21 10:02:42 -05:00
|
|
|
extensions = append(extensions, f.Extensions...)
|
|
|
|
}
|
|
|
|
return extensions
|
|
|
|
}
|