Documentation
¶
Index ¶
- Variables
- func AllowMissingXMLDeclaration() bool
- func GetCanonicalDirectoryName(metadataType string) string
- func GetMetadataDirectory(metadataType string) string
- func GetMetadataSuffix(metadataType string) string
- func GetParentType(childType string) string
- func IsChildType(metadataType string) bool
- func IsMetadataFile(path string) bool
- func MetadataFromPath(path string) (metadata.RegisterableMetadata, error)
- func RootElementName(xmlData []byte) (string, error)
- func SetAllowMissingXMLDeclaration(allow bool)
- type MetadataByPath
- type Repo
Constants ¶
This section is empty.
Variables ¶
var MetadataFileNotFound = errors.New("Could not identify metadata type")
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 ¶
GetCanonicalDirectoryName returns the proper directory name for a metadata type considering both the type itself and any parent-child relationships
func GetMetadataDirectory ¶
GetMetadataDirectory returns the canonical directory name for a given metadata type.
func GetMetadataSuffix ¶
GetMetadataSuffix returns the file suffix for a given metadata type
func GetParentType ¶
GetParentType returns the parent metadata type for child types like CustomField
func IsChildType ¶
IsChildType returns true if the metadata type is a child of another type
func IsMetadataFile ¶
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 SetAllowMissingXMLDeclaration ¶
func SetAllowMissingXMLDeclaration(allow bool)
SetAllowMissingXMLDeclaration enables parsing XML files that omit the XML declaration. By default, RootElementName requires a declaration.
Types ¶
type MetadataByPath ¶
type MetadataByPath map[metadata.MetadataFilePath]metadata.RegisterableMetadata
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
func (*Repo) AddItem ¶
func (o *Repo) AddItem(m metadata.RegisterableMetadata)
AddItem adds an already-loaded metadata item to the repo
func (*Repo) Items ¶
func (o *Repo) Items(t metadata.MetadataType) []metadata.RegisterableMetadata
Items returns all metadata items for a type as a slice
func (*Repo) Types ¶
func (o *Repo) Types() []metadata.MetadataType