mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 10:08:15 -05:00
7a0af318df
* mergers code optimize * api log work with pipe * remove inbounds/outbounds by tags *fix rmo flag parse * cmds description and message optimize
26 lines
627 B
Go
26 lines
627 B
Go
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
|
|
}
|
|
f, found := mergersByName[lowerName]
|
|
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)
|
|
for _, f := range mergersByName {
|
|
extensions = append(extensions, f.Extensions...)
|
|
}
|
|
return extensions
|
|
}
|