metadata

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("metadata: key not found")

Functions

func AssertBundleSlice

func AssertBundleSlice[T interface {
	comparable
	multiple
}](t *testing.T, bundle *Bundle, expected []T)

func AssertBundleValue

func AssertBundleValue[T interface {
	comparable
	single
}](t *testing.T, bundle *Bundle, expected T)

func DetectImageMIME

func DetectImageMIME(data []byte) string

DetectImageMIME reports the MIME type of image data by decoding it, or "application/octet-stream" if no registered image decoder recognizes it.

func Enumerate

func Enumerate[T multiple](b *Bundle) []T

func Get

func Get[T single](b *Bundle) T

func GetExt

func GetExt[T any](e *Extensions) T

Types

type Bundle

type Bundle baseBundle

func NewBundle

func NewBundle() *Bundle

func (*Bundle) AddRaw

func (b *Bundle) AddRaw(key string, value []byte)

func (*Bundle) AllRaw

func (b *Bundle) AllRaw() map[string][][]byte

func (*Bundle) Clear

func (b *Bundle) Clear()

func (*Bundle) Clone

func (b *Bundle) Clone() *Bundle

func (*Bundle) GetRaw

func (b *Bundle) GetRaw(key string) ([][]byte, bool)

func (*Bundle) Merge

func (b *Bundle) Merge(other *Bundle)

func (*Bundle) PushBack

func (b *Bundle) PushBack(value multiple)

func (*Bundle) PushFront

func (b *Bundle) PushFront(value multiple)

func (*Bundle) Set

func (b *Bundle) Set(value single)

func (*Bundle) SetIfEmpty

func (b *Bundle) SetIfEmpty(value single)

func (*Bundle) SetNonZero

func (b *Bundle) SetNonZero(value single)

func (*Bundle) SetNonZeroIfEmpty

func (b *Bundle) SetNonZeroIfEmpty(value single)

type Extensions

type Extensions baseBundle

func (*Extensions) Clear

func (e *Extensions) Clear()

func (*Extensions) Set

func (e *Extensions) Set(value any)

func (*Extensions) SetIfEmpty

func (e *Extensions) SetIfEmpty(value any)

func (*Extensions) SetNonZero

func (e *Extensions) SetNonZero(value any)

func (*Extensions) SetNonZeroIfEmpty

func (e *Extensions) SetNonZeroIfEmpty(value any)

type KeyAlbum

type KeyAlbum string

type KeyArtist

type KeyArtist string

type KeyComment

type KeyComment string

type KeyComposer

type KeyComposer string

type KeyCopyright

type KeyCopyright string

type KeyDate

type KeyDate date.Partial

type KeyDescription

type KeyDescription string

type KeyDiscNumber

type KeyDiscNumber int64

type KeyEncoder

type KeyEncoder string

type KeyFilename

type KeyFilename string

type KeyGenre

type KeyGenre string

type KeyId

type KeyId string

type KeyLicense

type KeyLicense string

type KeyLyrics

type KeyLyrics string

type KeyMimeType

type KeyMimeType string

type KeySize

type KeySize uint64

type KeyTag

type KeyTag string

type KeyThumbnail

type KeyThumbnail []Thumbnail

type KeyTitle

type KeyTitle string

type KeyTotalDiscs

type KeyTotalDiscs int64

type KeyTotalTracks

type KeyTotalTracks int64

type KeyTrackNumber

type KeyTrackNumber int64

type KeyWebsite

type KeyWebsite string

type PictureType

type PictureType uint8
const (
	PictureTypeOther      PictureType = 0x00
	PictureTypeFileIcon   PictureType = 0x01
	PictureTypeFrontCover PictureType = 0x03
	PictureTypeBackCover  PictureType = 0x04
)

type Thumbnail

type Thumbnail struct {
	Data        []byte
	MIMEType    string
	PictureType PictureType

	Description string

	Width         uint32
	Height        uint32
	ColorDepth    uint32
	IndexedColors uint32

	Extensions Extensions
}

func (*Thumbnail) FillImageProperties

func (t *Thumbnail) FillImageProperties() (*Thumbnail, error)

type TypeError

type TypeError struct {
	Expected string
	Actual   string
}

func (*TypeError) Error

func (e *TypeError) Error() string

Jump to

Keyboard shortcuts

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