Documentation
¶
Overview ¶
Package config defines configuration structures and loading logic.
Index ¶
Constants ¶
View Source
const ( // DeletePolicyCascade indicates that related items should be deleted when the source item is deleted. DeletePolicyCascade = "cascade" // DeletePolicyNone indicates that related items should not be deleted when the source item is deleted. DeletePolicyNone = "none" // ExtraRelationshipFamily indicates that the mapping is for relationships between items. ExtraRelationshipFamily = "relationships" APIVersionField = "apiVersion" DeletePolicyField = "deletePolicy" IdentifierField = "identifier" ItemFamilyField = "itemFamily" SourceRefField = "sourceRef" TargetRefField = "targetRef" TypeField = "type" TypeRefField = "typeRef" )
Variables ¶
View Source
var ( // ErrParsing reports failures that occur while decoding mapping files. ErrParsing = errors.New("error parsing") RequiredExtraFields = []string{APIVersionField, ItemFamilyField, DeletePolicyField, IdentifierField} )
Functions ¶
This section is empty.
Types ¶
type MappingConfig ¶
type MappingConfig struct {
Type string `json:"type" yaml:"type"`
Extra map[string]any `json:"extra,omitempty" yaml:"extra,omitempty"`
APIVersion string `json:"apiVersion" yaml:"apiVersion"`
ItemFamily string `json:"itemFamily" yaml:"itemFamily"`
Syncable bool `json:"syncable" yaml:"syncable"`
Mappings Mappings `json:"mappings" yaml:"mappings"`
}
MappingConfig holds the configuration for mapping rules.
func NewMappingConfigsFromPath ¶
func NewMappingConfigsFromPath(path string) ([]*MappingConfig, error)
NewMappingConfigsFromPath parses the file or directory at path and returns any mapping configurations it contains. It reports failures encountered while reading or decoding the data.
type Mappings ¶
type Mappings struct {
Identifier string `json:"identifier" yaml:"identifier"`
Metadata MetadataMapping `json:"metadata,omitempty" yaml:"metadata,omitempty"`
Spec map[string]string `json:"spec" yaml:"spec"`
Extra []Extra `json:"extra,omitempty" yaml:"extra,omitempty"`
}
Mappings holds the identifier and specification templates for mapping rules.
type MetadataMapping ¶
MetadataMapping holds a flattened representation of metadata templates.
func (*MetadataMapping) UnmarshalYAML ¶
func (mm *MetadataMapping) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML decodes YAML metadata templates and flattens them into a map.
type MetadataTemplate ¶
type MetadataTemplate struct {
Annotations string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
CreationTimestamp string `json:"creationTimestamp,omitempty" yaml:"creationTimestamp,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Labels string `json:"labels,omitempty" yaml:"labels,omitempty"`
Links string `json:"links,omitempty" yaml:"links,omitempty"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Tags string `json:"tags,omitempty" yaml:"tags,omitempty"`
Title string `json:"title,omitempty" yaml:"title,omitempty"`
UID string `json:"uid,omitempty" yaml:"uid,omitempty"`
}
MetadataTemplate is the strongly-typed representation of the metadata section in mapping files.
Click to show internal directories.
Click to hide internal directories.