metadata

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: 9 Imported by: 0

Documentation

Index

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)

Types

type FileContents

type FileContents struct {
	Path    string
	Content []byte
}

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 Format

type Format string

Format represents the metadata format (source or metadata)

const (
	SourceFormat   Format = "source"   // SFDX source format
	MetadataFormat Format = "metadata" // MDAPI metadata format
)

type MetadataFilePath

type MetadataFilePath string

type MetadataInfo

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

func (MetadataInfo) Contents

func (m MetadataInfo) Contents() []byte

func (MetadataInfo) GetMetadataInfo

func (m MetadataInfo) GetMetadataInfo() MetadataInfo

func (MetadataInfo) Name

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
}

Jump to

Keyboard shortcuts

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