mirror of
https://git.um-react.app/um/cli.git
synced 2025-11-28 11:43:02 +00:00
refactor: change decoder init parameter
This commit is contained in:
@@ -6,7 +6,13 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
type NewDecoderFunc func(rd io.ReadSeeker) Decoder
|
||||
type DecoderParams struct {
|
||||
Reader io.ReadSeeker // required
|
||||
Extension string // required, source extension, eg. ".mp3"
|
||||
|
||||
FilePath string // optional, source file path
|
||||
}
|
||||
type NewDecoderFunc func(p *DecoderParams) Decoder
|
||||
|
||||
type decoderItem struct {
|
||||
noop bool
|
||||
|
||||
@@ -14,8 +14,8 @@ type RawDecoder struct {
|
||||
audioExt string
|
||||
}
|
||||
|
||||
func NewRawDecoder(rd io.ReadSeeker) Decoder {
|
||||
return &RawDecoder{rd: rd}
|
||||
func NewRawDecoder(p *DecoderParams) Decoder {
|
||||
return &RawDecoder{rd: p.Reader}
|
||||
}
|
||||
|
||||
func (d *RawDecoder) Validate() error {
|
||||
|
||||
Reference in New Issue
Block a user