repo

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 105 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MetadataFileNotFound = errors.New("Could not identify metadata type")
View Source
var NotXMLError = errors.New("Could not parse as XML")

Functions

func AllowMissingXMLDeclaration

func AllowMissingXMLDeclaration() bool

AllowMissingXMLDeclaration reports whether XML declaration checks are disabled.

func GetCanonicalDirectoryName

func GetCanonicalDirectoryName(metadataType string) string

GetCanonicalDirectoryName returns the proper directory name for a metadata type considering both the type itself and any parent-child relationships

func GetMetadataDirectory

func GetMetadataDirectory(metadataType string) string

GetMetadataDirectory returns the canonical directory name for a given metadata type.

func GetMetadataSuffix

func GetMetadataSuffix(metadataType string) string

GetMetadataSuffix returns the file suffix for a given metadata type

func GetParentType

func GetParentType(childType string) string

GetParentType returns the parent metadata type for child types like CustomField

func IsChildType

func IsChildType(metadataType string) bool

IsChildType returns true if the metadata type is a child of another type

func IsMetadataFile

func IsMetadataFile(path string) bool

func MetadataFromPath

func MetadataFromPath(path string) (metadata.RegisterableMetadata, error)

If the file in path contains metadata, return it. Otherwise, try to find the corresponding file that contains metadata.

func RootElementName

func RootElementName(xmlData []byte) (string, error)

func SetAllowMissingXMLDeclaration

func SetAllowMissingXMLDeclaration(allow bool)

SetAllowMissingXMLDeclaration enables parsing XML files that omit the XML declaration. By default, RootElementName requires a declaration.

Types

type Repo

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

func NewRepo

func NewRepo() *Repo

func (*Repo) AddItem

func (o *Repo) AddItem(m metadata.RegisterableMetadata)

AddItem adds an already-loaded metadata item to the repo

func (*Repo) Items

Items returns all metadata items for a type as a slice

func (*Repo) Open

func (o *Repo) Open(file string) (metadata.MetadataPointer, error)

func (*Repo) Types

func (o *Repo) Types() []metadata.MetadataType

Jump to

Keyboard shortcuts

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