parser

package
v0.0.0-...-ddbbca1 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Directory

type Directory struct {
	Name string
	Tags []Tag
}

Directory represents a collection of tags.

type ParseError

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

ParseError holds multiple errors from parsing. Allows returning partial results with errors.

func NewParseError

func NewParseError(errs ...error) *ParseError

NewParseError creates a ParseError from multiple errors.

func (*ParseError) Add

func (e *ParseError) Add(err error)

Add appends an error to the ParseError.

func (*ParseError) Error

func (e *ParseError) Error() string

Error implements the error interface.

func (*ParseError) Is

func (e *ParseError) Is(target error) bool

Is allows errors.Is to match underlying errors.

func (*ParseError) Merge

func (e *ParseError) Merge(other *ParseError)

Merge merges another ParseError into this one.

func (*ParseError) OrNil

func (e *ParseError) OrNil() *ParseError

OrNil returns nil if there are no errors, otherwise returns the ParseError.

func (*ParseError) Unwrap

func (e *ParseError) Unwrap() []error

Unwrap returns the underlying errors.

type Parser

type Parser interface {
	// Name returns the parser name (e.g., "JPEG", "XMP")
	Name() string

	// Detect returns true if this parser can handle the data.
	Detect(r io.ReaderAt) bool

	// Parse returns parsed metadata directories and any errors encountered.
	// May return partial results even when errors occur.
	Parse(r io.ReaderAt) ([]Directory, *ParseError)
}

Parser is the interface for all parsers (JPEG, EXIF, XMP, etc.).

type Tag

type Tag struct {
	ID       TagID
	Name     string
	Value    any
	DataType string
}

Tag represents a metadata tag.

type TagID

type TagID string

TagID uniquely identifies a tag (e.g., "EXIF:IFD0:Make").

Directories

Path Synopsis
Package heic implements a parser for HEIC/HEIF and AVIF image files.
Package heic implements a parser for HEIC/HEIF and AVIF image files.
makernote
Package makernote provides MakerNote parsing for camera manufacturer-specific metadata.
Package makernote provides MakerNote parsing for camera manufacturer-specific metadata.
makernote/canon
Package canon provides parsing for Canon MakerNote data.
Package canon provides parsing for Canon MakerNote data.
makernote/fujifilm
Package fujifilm implements Fujifilm MakerNote parsing.
Package fujifilm implements Fujifilm MakerNote parsing.
makernote/nikon
Package nikon implements Nikon MakerNote parsing.
Package nikon implements Nikon MakerNote parsing.
makernote/sony
Package sony implements Sony MakerNote parsing.
Package sony implements Sony MakerNote parsing.

Jump to

Keyboard shortcuts

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