library

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildArchivePath added in v0.9.3

func BuildArchivePath(scheme, archivePath, inner string) string

BuildArchivePath builds an archive URI from scheme, archive path, and inner path.

func EntryExt added in v0.9.3

func EntryExt(value string) string

EntryExt returns the file extension for the entry portion of an archive URI.

func IsArchivePath added in v0.9.3

func IsArchivePath(value string) bool

IsArchivePath reports whether the value is an archive URI.

func IsAudio

func IsAudio(path string) bool

IsAudio reports whether the path is a supported audio file (including archive entries).

func OpenArchiveRoot

func OpenArchiveRoot(path string) (string, bool)

OpenArchiveRoot returns an archive URI for the root of the archive if the path is a supported archive file.

func SplitArchivePath added in v0.9.3

func SplitArchivePath(value string) (scheme, archivePath, inner string, err error)

SplitArchivePath parses an archive URI into scheme, archive path, and inner path.

Types

type ArchiveHandler added in v0.9.3

type ArchiveHandler interface {
	Scheme() string
	IsArchivePath(path string) bool
	List(path string, showHidden bool) ([]Entry, error)
	Open(path string) (io.ReadCloser, error)
}

ArchiveHandler manages a specific archive format (zip, tar, etc.).

func NewRarHandler added in v0.9.3

func NewRarHandler() ArchiveHandler

func NewSevenZipHandler added in v0.9.3

func NewSevenZipHandler() ArchiveHandler

func NewTarGzHandler added in v0.9.3

func NewTarGzHandler() ArchiveHandler

func NewTarHandler added in v0.9.3

func NewTarHandler() ArchiveHandler

func NewTarXzHandler added in v0.9.3

func NewTarXzHandler() ArchiveHandler

func NewZipHandler added in v0.9.3

func NewZipHandler() ArchiveHandler

type ArchiveRegistry added in v0.9.3

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

ArchiveRegistry is a collection of archive handlers.

func DefaultArchiveRegistry added in v0.9.3

func DefaultArchiveRegistry() *ArchiveRegistry

DefaultArchiveRegistry returns the shared registry of built-in handlers.

func (*ArchiveRegistry) FindHandler added in v0.9.3

func (r *ArchiveRegistry) FindHandler(path string) ArchiveHandler

FindHandler returns a handler that recognizes the path.

func (*ArchiveRegistry) Register added in v0.9.3

func (r *ArchiveRegistry) Register(handler ArchiveHandler)

Register adds a handler. Later handlers are checked after earlier ones.

type Entry

type Entry struct {
	Name      string
	Path      string
	IsDir     bool
	IsArchive bool
	IsAudio   bool
}

Entry represents a browsable item.

func List

func List(path string, showHidden bool) ([]Entry, error)

List returns directory or archive entries filtered to audio files, archives, and directories.

type Metadata

type Metadata struct {
	Artist      string
	Title       string
	Album       string
	AlbumArtist string
	Composer    string
	Genre       string
	Year        int
	Comment     string
	Lyrics      string
	Duration    time.Duration
	Picture     *Picture
}

Metadata captures audio tags for display.

func ReadMetadataBasic

func ReadMetadataBasic(path string) (Metadata, error)

ReadMetadataBasic reads basic audio tags (artist/title/album).

func ReadMetadataExtended

func ReadMetadataExtended(path string) (Metadata, error)

ReadMetadataExtended reads all supported audio tags (including artwork).

type Picture

type Picture struct {
	MIMEType    string
	Type        string
	Description string
	Data        []byte
}

Picture captures embedded album artwork data.

type TrackInfo

type TrackInfo struct {
	Path   string
	Name   string
	Artist string
	Title  string
	Album  string
}

TrackInfo is a minimal view of track fields used for metadata enrichment.

Jump to

Keyboard shortcuts

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