Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EqualFormats ¶
EqualFormats returns true if two Formats are the same type
Types ¶
type Format ¶
type Format struct {
// contains filtered or unexported fields
}
Format is union type of all known mediatype formats
func ID ¶
ID identifies media into a known mediatype format. If useSignature is true, then the existing file extension is ignored and we use the file magic signature instead REF: https://en.wikipedia.org/wiki/File_format#Magic_number
type FormatWithVisitor ¶
FormatWithVisitor is a generic Format union type visitor
func (*FormatWithVisitor[T]) Accept ¶
func (f *FormatWithVisitor[T]) Accept(ctx context.Context, v VisitorFunc[T]) (T, error)
Accept visits all known Format types
type HEIF ¶
type HEIF struct {
Path string
}
HEIF identifies HEIF media Ref: https://en.wikipedia.org/wiki/High_Efficiency_Image_File_Format
type JPEG ¶
type JPEG struct {
Path string
}
JPEG indetifies JPEG media REF: https://en.wikipedia.org/wiki/JPEG
type MP4 ¶
type MP4 struct {
Path string
}
MP4 indetifies Quicktime media Ref: https://en.wikipedia.org/wiki/MP4_file_format
type PNG ¶
type PNG struct {
Path string
}
PNG identifies PNG media. REF: https://en.wikipedia.org/wiki/PNG
type QTFF ¶
type QTFF struct {
Path string
}
QTFF indetifies Quicktime media Ref: https://en.wikipedia.org/wiki/QuickTime_File_Format
type TIFF ¶
type TIFF struct {
Path string
}
TIFF indetifies TIFF media REF: https://en.wikipedia.org/wiki/TIFF
type VisitorFunc ¶
type VisitorFunc[T any] interface { VisitJPEG(context.Context, JPEG) (T, error) VisitPNG(context.Context, PNG) (T, error) VisitHEIF(context.Context, HEIF) (T, error) VisitTIFF(context.Context, TIFF) (T, error) VisitQTFF(context.Context, QTFF) (T, error) VisitMP4(context.Context, MP4) (T, error) }
VisitorFunc implements a Visitor type that handles all known Format types