Versions in this module Expand all Collapse all v1 v1.0.1 May 9, 2021 Changes in this version + const ADD + const APPEND + const CREATE + const DEFAULT + const DELETE + const EXTEND + const MERGE + const NOFAIL + const REPLACE + const UNIQUE + const XMP_TOOLKIT_VERSION + const Xpacket + const Xpadding + var EEmptyValue = errors.New("empty value") + var EmptyName = xml.Name + var ErrOverflow = errors.New("xmp: document exceeds size limit") + func ConvertFilter(value string) reflect.Value + func DumpStats() + func GetLocaleField(v Model, lang string, name string) (string, error) + func GetModelPath(v Model, path Path) (string, error) + func GetNativeField(v Model, name string) (string, error) + func Marshal(d *Document) ([]byte, error) + func MarshalArray(e *Encoder, node *Node, typ ArrayType, items interface{}) error + func MarshalIndent(d *Document, prefix, indent string) ([]byte, error) + func Max(x, y int) int + func Max64(x, y int64) int64 + func Min(x, y int) int + func Min64(x, y int64) int64 + func NewName(local string) xml.Name + func Register(ns *Namespace, groups ...NamespaceGroup) + func ScanPackets(r io.Reader) ([][]byte, error) + func SetAgent(org, software, version, extra string) + func SetLocaleField(v Model, lang string, name, value string) error + func SetLogLevel(l LogLevelType) + func SetLogger(v Logger) + func SetModelPath(v Model, path Path, value string, flags SyncFlags) error + func SetNativeField(v Model, name, value string) error + func ToRawString(t interface{}) (string, error) + func ToString(t interface{}) string + func Unmarshal(data []byte, d *Document) error + func UnmarshalArray(d *Decoder, node *Node, typ ArrayType, out interface{}) error + type AgentName string + var Agent AgentName = XMP_TOOLKIT_VERSION + func (x AgentName) IsZero() bool + func (x AgentName) String() string + type AltItem struct + IsDefault bool + Lang string + Value string + func (x *AltItem) UnmarshalText(data []byte) error + func (x AltItem) GetLang() string + type AltString []AltItem + func NewAltString(items ...interface{}) AltString + func (a *AltString) Add(lang string, value string) + func (a *AltString) AddDefault(lang string, value string) + func (a *AltString) AddUnique(lang string, value string) bool + func (a *AltString) EnsureDefault() + func (a *AltString) RemoveLang(lang string) + func (a *AltString) Set(lang string, value string) + func (a AltString) Default() string + func (a AltString) Get(lang string) string + func (a AltString) Index(lang string) int + func (a AltString) Typ() ArrayType + func (x *AltString) UnmarshalXMP(d *Decoder, node *Node, m Model) error + func (x AltString) IsZero() bool + func (x AltString) MarshalXMP(e *Encoder, node *Node, m Model) error + type AltStringArray []*AltString + func NewAltStringArray(items ...*AltString) AltStringArray + func (x *AltStringArray) Add(v *AltString) error + func (x *AltStringArray) UnmarshalXMP(d *Decoder, node *Node, m Model) error + func (x AltStringArray) IsZero() bool + func (x AltStringArray) MarshalXMP(e *Encoder, node *Node, m Model) error + func (x AltStringArray) Typ() ArrayType + type Array interface + Typ func() ArrayType + type ArrayType string + const ArrayTypeAlternative + const ArrayTypeOrdered + const ArrayTypeUnordered + type Attr struct + Name xml.Name + Value string + type AttrList []Attr + func (x *AttrList) From(l []xml.Attr) + func (x AttrList) IsZero() bool + func (x AttrList) XML() []xml.Attr + type Bool bool + const False + const True + func (x *Bool) UnmarshalText(data []byte) error + func (x Bool) MarshalJSON() ([]byte, error) + func (x Bool) MarshalText() ([]byte, error) + func (x Bool) Value() bool + type ConverterFunc func(string) string + type Date time.Time + func NewDate(t time.Time) Date + func Now() Date + func ParseDate(value string) (Date, error) + func (x *Date) UnmarshalText(data []byte) error + func (x Date) IsZero() bool + func (x Date) MarshalText() ([]byte, error) + func (x Date) String() string + func (x Date) Time() Time + func (x Date) Value() time.Time + type DateList []Date + func (x *DateList) UnmarshalXMP(d *Decoder, node *Node, m Model) error + func (x DateList) MarshalXMP(e *Encoder, node *Node, m Model) error + func (x DateList) Typ() ArrayType + type Decoder struct + func NewDecoder(r io.Reader) *Decoder + func (d *Decoder) Decode(x *Document) error + func (d *Decoder) DecodeElement(v interface{}, src *Node) error + func (d *Decoder) SetVersion(v Version) + type Document struct + func NewDocument() *Document + func Read(r io.Reader) (*Document, error) + func Scan(r io.Reader) (*Document, error) + func (d *Document) AddModel(v Model) (*Node, error) + func (d *Document) Close() + func (d *Document) Dump() + func (d *Document) DumpNamespaces() + func (d *Document) FilterNamespaces(keep NamespaceList) bool + func (d *Document) FindModel(ns *Namespace) Model + func (d *Document) FindNode(ns *Namespace) *Node + func (d *Document) GetPath(path Path) (string, error) + func (d *Document) ListPaths() (PathValueList, error) + func (d *Document) MakeModel(ns *Namespace) (Model, error) + func (d *Document) MarshalJSON() ([]byte, error) + func (d *Document) Merge(b *Document, flags SyncFlags) error + func (d *Document) Namespaces() NamespaceList + func (d *Document) Nodes() NodeList + func (d *Document) RemoveNamespace(ns *Namespace) bool + func (d *Document) RemoveNamespaceByName(n string) bool + func (d *Document) RemoveNamespaces(remove NamespaceList) bool + func (d *Document) SetDirty() + func (d *Document) SetPath(desc PathValue) error + func (d *Document) Sync(sPath, dPath Path, flags SyncFlags, v Model, f ConverterFunc) error + func (d *Document) SyncModels() error + func (d *Document) SyncMulti(desc SyncDescList, m Model) error + func (d *Document) UnmarshalJSON(data []byte) error + func (d Document) FindNs(name, uri string) *Namespace + func (d Document) IsDirty() bool + type DocumentArray []*Document + func (x *DocumentArray) UnmarshalXMP(d *Decoder, node *Node, m Model) error + func (x DocumentArray) MarshalXMP(e *Encoder, node *Node, m Model) error + func (x DocumentArray) Typ() ArrayType + type Duration time.Duration + func ParseDuration(d string) (Duration, error) + func (d *Duration) UnmarshalJSON(data []byte) error + func (d *Duration) UnmarshalText(data []byte) error + func (d Duration) Duration() time.Duration + func (d Duration) MarshalText() ([]byte, error) + func (d Duration) RoundToDays() int + func (d Duration) RoundToHours() int64 + func (d Duration) RoundToMillisecond() int64 + func (d Duration) RoundToMinutes() int64 + func (d Duration) RoundToSeconds() int64 + func (d Duration) String() string + func (d Duration) Truncate(r time.Duration) Duration + type Encoder struct + func NewEncoder(w io.Writer) *Encoder + func (e *Encoder) Encode(d *Document) error + func (e *Encoder) EncodeElement(v interface{}, node *Node) error + func (e *Encoder) Indent(prefix, indent string) + func (e *Encoder) SetFlags(flags int) + func (e *Encoder) SetMaxSize(size int64) + type Extension Node + func (x *Extension) FindNodeByName(name string) *Node + func (x *Extension) IsZero() bool + func (x *Extension) MarshalXML(e *xml.Encoder, start xml.StartElement) error + func (x *Extension) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + func (x *Extension) UnmarshalXMP(d *Decoder, src *Node, m Model) error + func (x *Extension) UnmarshalXMPAttr(d *Decoder, a Attr) error + func (x Extension) MarshalXMP(e *Encoder, node *Node, m Model) error + type ExtensionArray []*Extension + func (x *ExtensionArray) UnmarshalXMP(d *Decoder, node *Node, m Model) error + func (x ExtensionArray) MarshalXMP(e *Encoder, node *Node, m Model) error + func (x ExtensionArray) Typ() ArrayType + type Filter struct + func NewFilter(include, exclude NamespaceList) *Filter + func ParseFilter(s string) *Filter + func ParseFilterStrict(s string) (*Filter, error) + func (x *Filter) UnmarshalText(b []byte) error + func (x Filter) Apply(d *Document) bool + func (x Filter) String() string + type GPSCoord string + func (x GPSCoord) IsZero() bool + func (x GPSCoord) Value() string + type GUID string + func (x *GUID) UnmarshalText(data []byte) error + func (x GUID) IsZero() bool + func (x GUID) Issuer() string + func (x GUID) MarshalText() ([]byte, error) + func (x GUID) MarshalXMP(e *Encoder, node *Node, m Model) error + func (x GUID) String() string + func (x GUID) Value() string + type GUIDList []GUID + func (x *GUIDList) UnmarshalXMP(d *Decoder, node *Node, m Model) error + func (x GUIDList) MarshalXMP(e *Encoder, node *Node, m Model) error + func (x GUIDList) Typ() ArrayType + type IntArray []int + func NewIntArray(items ...int) IntArray + func (x *IntArray) Add(v int) error + func (x *IntArray) UnmarshalXMP(d *Decoder, node *Node, m Model) error + func (x IntArray) IsZero() bool + func (x IntArray) MarshalXMP(e *Encoder, node *Node, m Model) error + func (x IntArray) Typ() ArrayType + type IntList []int + func NewIntList(items ...int) IntList + func (x *IntList) Add(v int) error + func (x *IntList) UnmarshalXMP(d *Decoder, node *Node, m Model) error + func (x IntList) IsZero() bool + func (x IntList) MarshalXMP(e *Encoder, node *Node, m Model) error + func (x IntList) String() string + func (x IntList) Typ() ArrayType + type LogLevelType int + const LogLevelDebug + const LogLevelError + const LogLevelInfo + const LogLevelInvalid + const LogLevelWarning + func LogLevel() LogLevelType + func (l LogLevelType) Prefix() string + type LogType struct + func (x LogType) Debug(v ...interface{}) + func (x LogType) Debugf(s string, v ...interface{}) + func (x LogType) Error(v ...interface{}) + func (x LogType) Errorf(s string, v ...interface{}) + func (x LogType) Info(v ...interface{}) + func (x LogType) Infof(s string, v ...interface{}) + func (x LogType) Warn(v ...interface{}) + func (x LogType) Warnf(s string, v ...interface{}) + type Logger interface + Debug func(v ...interface{}) + Debugf func(s string, v ...interface{}) + Error func(v ...interface{}) + Errorf func(s string, v ...interface{}) + Info func(v ...interface{}) + Infof func(s string, v ...interface{}) + Warn func(v ...interface{}) + Warnf func(s string, v ...interface{}) + var Log Logger = &LogType{} + type Marshaler interface + MarshalXMP func(e *Encoder, n *Node, model Model) error + type MarshalerAttr interface + MarshalXMPAttr func(e *Encoder, name xml.Name, n *Node) (Attr, error) + type Model interface + Can func(nsName string) bool + CanTag func(tag string) bool + GetTag func(tag string) (string, error) + Namespaces func() NamespaceList + SetTag func(tag, value string) error + SyncFromXMP func(d *Document) error + SyncModel func(d *Document) error + SyncToXMP func(d *Document) error + type ModelFactory func(name string) Model + type NamedExtensionArray []*Extension + func (x *NamedExtensionArray) FindNodeByName(name string) *Node + func (x *NamedExtensionArray) UnmarshalXMP(d *Decoder, node *Node, m Model) error + func (x NamedExtensionArray) MarshalXMP(e *Encoder, node *Node, m Model) error + func (x NamedExtensionArray) Typ() ArrayType + type Namespace struct + Factory ModelFactory + Name string + URI string + func GetNamespace(prefix string) (*Namespace, error) + func NewNamespace(name, uri string, factory ModelFactory) *Namespace + func (n Namespace) Expand(local string) string + func (n Namespace) GetAttr() Attr + func (n Namespace) GetName() string + func (n Namespace) GetURI() string + func (n Namespace) MatchAttrName(name string) bool + func (n Namespace) MatchXMLName(name xml.Name) bool + func (n Namespace) NewModel() Model + func (n Namespace) RootName() xml.Name + func (n Namespace) Split(name string) string + func (n Namespace) XMLName(local string) xml.Name + type NamespaceGroup string + const CameraMetadata + const ImageMetadata + const MovieMetadata + const MusicMetadata + const NoMetadata + const RightsMetadata + const SoundMetadata + const VfxMetadata + const XmpMetadata + func ParseNamespaceGroup(s string) NamespaceGroup + func (g NamespaceGroup) Contains(ns *Namespace) bool + func (g NamespaceGroup) Namespaces() NamespaceList + type NamespaceGroupList []NamespaceGroup + func (l NamespaceGroupList) Contains(ns *Namespace) bool + type NamespaceList []*Namespace + func GetGroupNamespaces(group NamespaceGroup) (NamespaceList, error) + func (l *NamespaceList) RemoveDups() NamespaceList + func (l NamespaceList) Contains(ns *Namespace) bool + func (l NamespaceList) ContainsName(n string) bool + type Node struct + Attr AttrList + Model Model + Nodes NodeList + Value string + XMLName xml.Name + func NewNode(name xml.Name) *Node + func (n *Node) AddAttr(attr Attr) + func (n *Node) AddNode(x *Node) *Node + func (n *Node) AddStringAttr(name, value string) + func (n *Node) AppendNode(x *Node) *Node + func (n *Node) Clear() + func (n *Node) Close() + func (n *Node) FullName() string + func (n *Node) GetAttr(ns, name string) []Attr + func (n *Node) GetPath(path Path) (string, error) + func (n *Node) IsZero() bool + func (n *Node) ListPaths(path Path) (PathValueList, error) + func (n *Node) MarshalXML(e *xml.Encoder, start xml.StartElement) error + func (n *Node) Name() string + func (n *Node) Namespace() string + func (n *Node) Namespaces(d *Document) NamespaceList + func (n *Node) RemoveNode(x *Node) *Node + func (n *Node) SetPath(path Path, value string, flags SyncFlags) error + func (n *Node) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + func (n Node) ArrayType() ArrayType + func (n Node) Dump(d int) + func (n Node) IsArray() bool + type NodeList []*Node + func (n *NodeList) FindNode(ns *Namespace) *Node + func (n *NodeList) FindNodeByName(prefix string) *Node + func (x *NodeList) AddNode(n *Node) *Node + func (x *NodeList) AppendNode(n *Node) *Node + func (x *NodeList) Index(n *Node) int + func (x *NodeList) RemoveNode(n *Node) *Node + type NullBool bool + func ParseNullBool(d string) (NullBool, error) + func (x *NullBool) UnmarshalJSON(data []byte) error + func (x *NullBool) UnmarshalText(data []byte) error + func (x NullBool) MarshalJSON() ([]byte, error) + func (x NullBool) MarshalText() ([]byte, error) + func (x NullBool) Value() bool + type NullFloat float32 + func ParseNullFloat(d string) (NullFloat, error) + func (f *NullFloat) UnmarshalJSON(data []byte) error + func (f *NullFloat) UnmarshalText(data []byte) error + func (f NullFloat) Float32() float32 + func (f NullFloat) MarshalJSON() ([]byte, error) + func (f NullFloat) MarshalText() ([]byte, error) + func (f NullFloat) Value() float64 + type NullFloat64 float64 + func ParseNullFloat64(d string) (NullFloat64, error) + func (f *NullFloat64) UnmarshalJSON(data []byte) error + func (f *NullFloat64) UnmarshalText(data []byte) error + func (f NullFloat64) Float64() float64 + func (f NullFloat64) MarshalJSON() ([]byte, error) + func (f NullFloat64) MarshalText() ([]byte, error) + func (f NullFloat64) Value() float64 + type NullInt int + func ParseNullInt(d string) (NullInt, error) + func (i *NullInt) UnmarshalJSON(data []byte) error + func (i *NullInt) UnmarshalText(data []byte) error + func (i NullInt) Int() int + func (i NullInt) MarshalJSON() ([]byte, error) + func (i NullInt) MarshalText() ([]byte, error) + func (i NullInt) Value() int + type NullString string + func ParseNullString(s string) (NullString, error) + func (s *NullString) UnmarshalText(data []byte) error + func (s NullString) MarshalText() ([]byte, error) + func (s NullString) String() string + func (s NullString) Value() string + type Path string + func NewPath(prefix string, segments ...string) Path + func (x *Path) UnmarshalText(data []byte) error + func (x Path) AppendIndex(i int) Path + func (x Path) AppendIndexString(s string) Path + func (x Path) Fields() []string + func (x Path) IsXmpPath() bool + func (x Path) Len() int + func (x Path) MatchNamespace(ns *Namespace) bool + func (x Path) Namespace(d *Document) (*Namespace, error) + func (x Path) NamespacePrefix() string + func (x Path) PeekNamespacePrefix() string + func (x Path) Pop() (string, Path) + func (x Path) PopFront() (string, Path) + func (x Path) Push(segment ...string) Path + func (x Path) String() string + type PathValue struct + Flags SyncFlags + Namespace string + Path Path + Value string + type PathValueList []PathValue + func ListModelPaths(v Model) (PathValueList, error) + func (x *PathValueList) Add(p Path, v string) + func (x *PathValueList) AddFlags(p Path, v string, f SyncFlags) + func (x PathValueList) Diff(y PathValueList) PathValueList + func (x PathValueList) Find(p Path) *PathValue + func (x PathValueList) Unique() PathValueList + type Rational struct + Den int64 + Num int64 + func FloatToRational(f float32) Rational + func (x *Rational) Addr() *Rational + func (x *Rational) UnmarshalText(data []byte) error + func (x Rational) IsZero() bool + func (x Rational) MarshalText() ([]byte, error) + func (x Rational) String() string + func (x Rational) Value() float64 + type RationalArray []Rational + func NewRationalArray(items ...Rational) RationalArray + func (a *RationalArray) UnmarshalXMP(d *Decoder, node *Node, m Model) error + func (a RationalArray) MarshalXMP(e *Encoder, node *Node, m Model) error + func (a RationalArray) Typ() ArrayType + type Registry struct + var NsRegistry Registry = Registry{} + func (r *Registry) GetGroupNamespaces(group NamespaceGroup) (NamespaceList, error) + func (r *Registry) GetNamespace(prefix string) (*Namespace, error) + func (r *Registry) GetPrefix(uri string) string + func (r *Registry) Namespaces() NamespaceList + func (r *Registry) Prefixes() []string + func (r *Registry) RegisterNamespace(ns *Namespace, groups NamespaceGroupList) + func (r *Registry) Short(uri, name string) string + type SplitInt uint32 + func (x *SplitInt) UnmarshalText(data []byte) error + func (x SplitInt) Uint32() uint32 + func (x SplitInt) Value() uint32 + type StringArray []string + func NewStringArray(items ...string) StringArray + func (x *StringArray) Add(v string) error + func (x *StringArray) AddUnique(v string) error + func (x *StringArray) Contains(v string) bool + func (x *StringArray) Index(val string) int + func (x *StringArray) Remove(v string) + func (x *StringArray) UnmarshalText(data []byte) error + func (x *StringArray) UnmarshalXMP(d *Decoder, node *Node, m Model) error + func (x StringArray) IsZero() bool + func (x StringArray) MarshalText() ([]byte, error) + func (x StringArray) MarshalXMP(e *Encoder, node *Node, m Model) error + func (x StringArray) Typ() ArrayType + type StringList []string + func NewStringList(items ...string) StringList + func (x *StringList) Add(v string) error + func (x *StringList) AddUnique(v string) error + func (x *StringList) Contains(v string) bool + func (x *StringList) Index(val string) int + func (x *StringList) Remove(v string) + func (x *StringList) UnmarshalText(data []byte) error + func (x *StringList) UnmarshalXMP(d *Decoder, node *Node, m Model) error + func (x StringList) IsZero() bool + func (x StringList) MarshalText() ([]byte, error) + func (x StringList) MarshalXMP(e *Encoder, node *Node, m Model) error + func (x StringList) Typ() ArrayType + type SyncDesc struct + Convert ConverterFunc + Dest Path + Flags SyncFlags + Source Path + type SyncDescList []*SyncDesc + type SyncFlags int + func ParseSyncFlag(s string) SyncFlags + func ParseSyncFlags(s string) (SyncFlags, error) + func (f *SyncFlags) UnmarshalText(data []byte) error + type Tag struct + Key string + Lang string + Value string + type TagList []Tag + func ListNativeFields(v Model) (TagList, error) + func (x *TagList) UnmarshalXMP(d *Decoder, node *Node, m Model) error + func (x TagList) MarshalXMP(e *Encoder, node *Node, m Model) error + type Time time.Time + func NewTime(t time.Time) Time + func ParseTime(value string) (Time, error) + func (x *Time) UnmarshalText(data []byte) error + func (x Time) IsZero() bool + func (x Time) MarshalText() ([]byte, error) + func (x Time) String() string + func (x Time) Value() time.Time + type UnknownNamespaceError struct + Name xml.Name + func (e *UnknownNamespaceError) Error() string + type Unmarshaler interface + UnmarshalXMP func(d *Decoder, n *Node, model Model) error + type UnmarshalerAttr interface + UnmarshalXMPAttr func(d *Decoder, a Attr) error + type Uri string + func NewUri(u string) Uri + func (x *Uri) UnmarshalXMP(d *Decoder, node *Node, m Model) error + func (x Uri) IsZero() bool + func (x Uri) Value() string + type UriArray []Uri + func (x *UriArray) UnmarshalXMP(d *Decoder, node *Node, m Model) error + func (x UriArray) IsZero() bool + func (x UriArray) MarshalXMP(e *Encoder, node *Node, m Model) error + func (x UriArray) Typ() ArrayType + type UriList []Uri + func (x *UriList) UnmarshalXMP(d *Decoder, node *Node, m Model) error + func (x UriList) IsZero() bool + func (x UriList) MarshalXMP(e *Encoder, node *Node, m Model) error + func (x UriList) Typ() ArrayType + type Url string + func (x Url) IsZero() bool + func (x Url) Value() string + type UrlArray []Url + func (x *UrlArray) UnmarshalXMP(d *Decoder, node *Node, m Model) error + func (x UrlArray) MarshalXMP(e *Encoder, node *Node, m Model) error + func (x UrlArray) Typ() ArrayType + type UrlList []Url + func (x *UrlList) UnmarshalXMP(d *Decoder, node *Node, m Model) error + func (x UrlList) MarshalXMP(e *Encoder, node *Node, m Model) error + func (x UrlList) Typ() ArrayType + type Version struct + Major int + Minor int + Patch int + func ParseVersion(s string) (Version, error) + func (v Version) After(a Version) bool + func (v Version) Before(a Version) bool + func (v Version) Between(a, b Version) bool + func (v Version) Equal(a Version) bool + func (v Version) IsZero() bool + func (v Version) String() string + type Zero interface + IsZero func() bool