You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
unlock-music-cli/algo/common/dispatch.go

13 lines
326 B
Go

package common
type NewDecoderFunc func([]byte) Decoder
var decoderRegistry = make(map[string][]NewDecoderFunc)
func RegisterDecoder(ext string, dispatchFunc NewDecoderFunc) {
decoderRegistry[ext] = append(decoderRegistry[ext], dispatchFunc)
}
func GetDecoder(ext string) []NewDecoderFunc {
return decoderRegistry[ext]
}