common

package
v0.2.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DecoderRegistry []DecoderFactory

Functions

func RegisterDecoder

func RegisterDecoder(ext string, noop bool, dispatchFunc NewDecoderFunc)

Types

type AudioMeta

type AudioMeta interface {
	GetArtists() []string
	GetTitle() string
	GetAlbum() string
}

func ParseFilenameMeta

func ParseFilenameMeta(filename string) (meta AudioMeta)

type AudioMetaGetter

type AudioMetaGetter interface {
	GetAudioMeta(ctx context.Context) (AudioMeta, error)
}

type CoverImageGetter

type CoverImageGetter interface {
	GetCoverImage(ctx context.Context) ([]byte, error)
}

type CryptoParams

type CryptoParams struct {
	// KuGou kgg database path
	KggDbPath string

	// QMC Crypto config
	QmcKeys QMCKeys
}

type Decoder

type Decoder interface {
	Validate() error
	io.Reader
}

func NewRawDecoder

func NewRawDecoder(p *DecoderParams) Decoder

type DecoderFactory

type DecoderFactory struct {
	Suffix string
	Create NewDecoderFunc
	// contains filtered or unexported fields
}

func GetDecoder

func GetDecoder(filename string, skipNoop bool) []DecoderFactory

type DecoderParams

type DecoderParams struct {
	Reader    io.ReadSeeker // required
	Extension string        // required, source extension, eg. ".mp3"

	FilePath string // optional, source file path

	Logger *zap.Logger // required

	CryptoParams CryptoParams
}

type NewDecoderFunc

type NewDecoderFunc func(p *DecoderParams) Decoder

type QMCKeys

type QMCKeys map[string]string

func (QMCKeys) Get

func (k QMCKeys) Get(key string) (string, bool)

type RawDecoder

type RawDecoder struct {
	// contains filtered or unexported fields
}

func (*RawDecoder) Read

func (d *RawDecoder) Read(p []byte) (n int, err error)

func (*RawDecoder) Validate

func (d *RawDecoder) Validate() error

type StreamDecoder

type StreamDecoder interface {
	Decrypt(buf []byte, offset int)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL