Documentation
¶
Index ¶
- func DefaultFiles(m RegisterableMetadata, format Format) (map[string][]byte, error)
- func ParseMetadataXml(i MetadataPointer, path string) error
- func ParseMetadataXmlIfPossible(i MetadataPointer, path string) ([]byte, error)
- func PathWithinDirectory(path string, dir string) (string, bool)
- type FileContents
- type FilesGenerator
- type Format
- type MetadataFilePath
- type MetadataInfo
- type MetadataObjectName
- type MetadataPointer
- type MetadataType
- type RegisterableMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultFiles ¶
func DefaultFiles(m RegisterableMetadata, format Format) (map[string][]byte, error)
DefaultFiles provides a default implementation of the Files method for metadata types that consist of a single XML file without associated code files
func ParseMetadataXml ¶
func ParseMetadataXml(i MetadataPointer, path string) error
func ParseMetadataXmlIfPossible ¶
func ParseMetadataXmlIfPossible(i MetadataPointer, path string) ([]byte, error)
func PathWithinDirectory ¶ added in v0.69.0
PathWithinDirectory returns the part of path below the last path segment named dir, such as "Folder/Report.report" for "src/reports/Folder/Report.report" and dir "reports". The second return value is false if no segment of path is named dir. Matching whole segments means that a folder whose name ends with dir, like "RegistrationsDBreports", is not mistaken for the directory itself.
Types ¶
type FileContents ¶
FileContents represents a file's path and content
type FilesGenerator ¶
type FilesGenerator interface {
// Files returns a map of files that make up this metadata component
// The map key is the relative file path, the value contains the content
Files(format Format) (map[string][]byte, error)
}
FilesGenerator is an optional interface that metadata types can implement to provide custom file generation logic
type MetadataFilePath ¶
type MetadataFilePath string
type MetadataInfo ¶
type MetadataInfo struct {
// contains filtered or unexported fields
}
func NewMetadataInfo ¶ added in v0.53.1
func NewMetadataInfo(name MetadataObjectName, path MetadataFilePath) MetadataInfo
NewMetadataInfo builds the info for metadata that was composed in memory rather than parsed from a file.
func (MetadataInfo) Contents ¶
func (m MetadataInfo) Contents() []byte
func (MetadataInfo) GetMetadataInfo ¶
func (m MetadataInfo) GetMetadataInfo() MetadataInfo
func (MetadataInfo) Name ¶
func (m MetadataInfo) Name() MetadataObjectName
func (MetadataInfo) NameFromPath ¶
func (m MetadataInfo) NameFromPath(path string) MetadataObjectName
func (MetadataInfo) Path ¶
func (m MetadataInfo) Path() MetadataFilePath
type MetadataObjectName ¶
type MetadataObjectName string
func NameFromPath ¶
func NameFromPath(path string) MetadataObjectName
type MetadataPointer ¶
type MetadataPointer interface {
// SetMetadata should have a pointer receiver. This ensures that functions
// that take a MetadataPointer receive a pointer.
SetMetadata(MetadataInfo)
NameFromPath(path string) MetadataObjectName
}
type MetadataType ¶
type MetadataType = string
type RegisterableMetadata ¶
type RegisterableMetadata interface {
MetadataPointer
GetMetadataInfo() MetadataInfo
Type() MetadataType
}