mappings

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2016 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

This file contains struct mappings to unmarshal three different PRONOM XML formats: the signature file format, the report format, and the container format

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteSeq

type ByteSeq struct {
	Reference    string        `xml:"Reference,attr"`
	SubSequences []SubSequence `xml:"SubSequence"`
}

type ByteSequence

type ByteSequence struct {
	Position    string `xml:"PositionType"`
	Offset      string
	MaxOffset   string
	IndirectLoc string `xml:"IndirectOffsetLocation"`
	IndirectLen string `xml:"IndirectOffsetLength"`
	Endianness  string
	Hex         string `xml:"ByteSequenceValue"`
}

func (ByteSequence) String

func (bs ByteSequence) String() string

type Container

type Container struct {
	XMLName             xml.Name             `xml:"ContainerSignatureMapping"`
	ContainerSignatures []ContainerSignature `xml:"ContainerSignatures>ContainerSignature"`
	FormatMappings      []FormatMapping      `xml:"FileFormatMappings>FileFormatMapping"`
	TriggerPuids        []TriggerPuid        `xml:"TriggerPuids>TriggerPuid"`
}

func (*Container) Puids

func (c *Container) Puids() []string

type ContainerSignature

type ContainerSignature struct {
	Id            int    `xml:",attr"`
	ContainerType string `xml:",attr"`
	Description   string
	Files         []File `xml:"Files>File"`
}

type Droid

type Droid struct {
	XMLName     xml.Name            `xml:"FFSignatureFile"`
	Version     int                 `xml:",attr"`
	Signatures  []InternalSignature `xml:"InternalSignatureCollection>InternalSignature"`
	FileFormats []FileFormat        `xml:"FileFormatCollection>FileFormat"`
}

type File

type File struct {
	Path      string
	Signature InternalSignature `xml:"BinarySignatures>InternalSignatureCollection>InternalSignature"` // see Droid mapping file
}

type FileFormat

type FileFormat struct {
	XMLName    xml.Name `xml:"FileFormat"`
	Id         int      `xml:"ID,attr"`
	Puid       string   `xml:"PUID,attr"`
	Name       string   `xml:",attr"`
	Version    string   `xml:",attr"`
	MIMEType   string   `xml:",attr"`
	Extensions []string `xml:"Extension"`
	Signatures []int    `xml:"InternalSignatureID"`
	Priorities []int    `xml:"HasPriorityOverFileFormatID"`
}

type FormatIdentifier

type FormatIdentifier struct {
	Typ string `xml:"IdentifierType"`
	Id  string `xml:"Identifier"`
}

type FormatMapping

type FormatMapping struct {
	Id   int    `xml:"signatureId,attr"`
	Puid string `xml:",attr"`
}

type Fragment

type Fragment struct {
	Value     string `xml:",chardata"`
	MinOffset string `xml:",attr"`
	MaxOffset string `xml:",attr"`
	Position  int    `xml:",attr"`
}

type InternalSignature

type InternalSignature struct {
	Id            int       `xml:"ID,attr"`
	ByteSequences []ByteSeq `xml:"ByteSequence"`
}

type RelatedFormat

type RelatedFormat struct {
	Typ string `xml:"RelationshipType"`
	Id  int    `xml:"RelatedFormatID"`
}

type Report

type Report struct {
	XMLName     xml.Name           `xml:"PRONOM-Report"`
	Id          int                `xml:"report_format_detail>FileFormat>FormatID"`
	Name        string             `xml:"report_format_detail>FileFormat>FormatName"`
	Version     string             `xml:"report_format_detail>FileFormat>FormatVersion"`
	Description string             `xml:"report_format_detail>FileFormat>FormatDescription"`
	Identifiers []FormatIdentifier `xml:"report_format_detail>FileFormat>FileFormatIdentifier"`
	Signatures  []Signature        `xml:"report_format_detail>FileFormat>InternalSignature"`
	Extensions  []string           `xml:"report_format_detail>FileFormat>ExternalSignature>Signature"`
	Relations   []RelatedFormat    `xml:"report_format_detail>FileFormat>RelatedFormat"`
}

func (*Report) MIME

func (r *Report) MIME() string

func (*Report) Subordinates

func (r *Report) Subordinates() []int

func (*Report) Superiors

func (r *Report) Superiors() []int

type Signature

type Signature struct {
	ByteSequences []ByteSequence `xml:"ByteSequence"`
}

func (Signature) String

func (s Signature) String() string

type SubSequence

type SubSequence struct {
	Position        int    `xml:",attr"`
	SubSeqMinOffset string `xml:",attr"` // and empty int values are unmarshalled to 0
	SubSeqMaxOffset string `xml:",attr"` // uses string rather than int because value might be empty
	Sequence        string
	LeftFragments   []Fragment `xml:"LeftFragment"`
	RightFragments  []Fragment `xml:"RightFragment"`
}

type TriggerPuid

type TriggerPuid struct {
	ContainerType string `xml:",attr"`
	Puid          string `xml:",attr"`
}

Jump to

Keyboard shortcuts

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