Documentation
¶
Index ¶
- type Loader
- func (l *Loader) FindPipelinesByUse(yamlContent []byte, useType string) ([]int, error)
- func (l *Loader) GetGoBumpDeps(yamlContent []byte, pipelineIndex int) ([]string, error)
- func (l *Loader) GetPackageInfo(yamlContent []byte) (name, version string, epoch int64, err error)
- func (l *Loader) GetPipelineWithField(yamlContent []byte, pipelineIndex int) (map[string]string, error)
- func (l *Loader) IncrementEpoch(yamlContent []byte) ([]byte, error)
- func (l *Loader) InsertGoBumpPipelineStep(yamlContent []byte, pipelineIndex int, deps []string) ([]byte, error)
- func (l *Loader) InsertPipelineStep(yamlContent []byte, pipelineIndex int, pipelineStep map[string]any) ([]byte, error)
- func (l *Loader) LoadWithPreservation(path string) (*config.Configuration, []byte, error)
- func (l *Loader) RemovePipelineStep(yamlContent []byte, pipelineIndex int) ([]byte, error)
- func (l *Loader) Save(path string, content []byte, backupSuffix string) error
- func (l *Loader) SaveWithBackup(path string, content []byte) error
- func (l *Loader) SetEpoch(yamlContent []byte, newEpoch int64) ([]byte, error)
- func (l *Loader) UpdateField(yamlContent []byte, path, newValue string) ([]byte, error)
- func (l *Loader) UpdateFieldAsQuotedString(yamlContent []byte, path string, newValue string) ([]byte, error)
- func (l *Loader) UpdateFieldWithBlockScalar(yamlContent []byte, path string, newValue string) ([]byte, error)
- func (l *Loader) UpdateGoBumpDeps(yamlContent []byte, pipelineIndex int, newDeps []string) ([]byte, error)
- func (l *Loader) UpdateIntField(yamlContent []byte, path string, newValue int64) ([]byte, error)
- func (l *Loader) UpdatePackageVersion(yamlContent []byte, newVersion string) ([]byte, error)
- func (l *Loader) UpdatePipelineField(yamlContent []byte, pipelineIndex int, field, newValue string) ([]byte, error)
- func (l *Loader) ValidateUpdatedConfig(content []byte, tempPath string) error
- type Renderer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Loader ¶
type Loader struct{}
Loader handles loading and saving melange configurations while preserving YAML structure
func (*Loader) FindPipelinesByUse ¶
FindPipelinesByUse finds pipeline indices that use a specific pipeline type
func (*Loader) GetGoBumpDeps ¶
GetGoBumpDeps extracts the deps field from a go/bump pipeline
func (*Loader) GetPackageInfo ¶
GetPackageInfo extracts package name and version from YAML content
func (*Loader) GetPipelineWithField ¶
func (l *Loader) GetPipelineWithField(yamlContent []byte, pipelineIndex int) (map[string]string, error)
GetPipelineWithField gets the with field map for a specific pipeline
func (*Loader) IncrementEpoch ¶
IncrementEpoch increments the epoch field by 1
func (*Loader) InsertGoBumpPipelineStep ¶
func (l *Loader) InsertGoBumpPipelineStep(yamlContent []byte, pipelineIndex int, deps []string) ([]byte, error)
InsertGoBumpPipelineStep inserts a go/bump step with block scalar deps
func (*Loader) InsertPipelineStep ¶
func (l *Loader) InsertPipelineStep(yamlContent []byte, pipelineIndex int, pipelineStep map[string]any) ([]byte, error)
InsertPipelineStep inserts a new pipeline step at the specified index
func (*Loader) LoadWithPreservation ¶
LoadWithPreservation loads a melange config while preserving YAML structure and comments
func (*Loader) RemovePipelineStep ¶
RemovePipelineStep removes a single pipeline step by index while preserving formatting
func (*Loader) Save ¶
Save saves the updated YAML content to file, optionally creating a backup backupSuffix: suffix for backup files (empty = no backup) Returns error if save failed, nil if no changes needed or save successful
func (*Loader) SaveWithBackup ¶
SaveWithBackup saves the updated YAML content to file with backup
func (*Loader) UpdateField ¶
UpdateField updates a specific field in the YAML while preserving structure
func (*Loader) UpdateFieldAsQuotedString ¶
func (l *Loader) UpdateFieldAsQuotedString(yamlContent []byte, path string, newValue string) ([]byte, error)
UpdateFieldAsQuotedString updates a field with a double-quoted string value This is essential for fields like package.version where values like "1.0" must be rendered as strings to prevent YAML from interpreting them as numbers
func (*Loader) UpdateFieldWithBlockScalar ¶
func (l *Loader) UpdateFieldWithBlockScalar(yamlContent []byte, path string, newValue string) ([]byte, error)
UpdateFieldWithBlockScalar updates a field to use block scalar format (|-)
func (*Loader) UpdateGoBumpDeps ¶
func (l *Loader) UpdateGoBumpDeps(yamlContent []byte, pipelineIndex int, newDeps []string) ([]byte, error)
UpdateGoBumpDeps updates the deps field in a go/bump pipeline
func (*Loader) UpdateIntField ¶
UpdateIntField updates an integer field in the YAML
func (*Loader) UpdatePackageVersion ¶
UpdatePackageVersion updates the package version (epoch handling moved to EpochApplier)
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer provides variable rendering for melange configurations It builds a complete variable context and can render strings or entire configs
func NewRenderer ¶
func NewRenderer(cfg *melange.Configuration) (*Renderer, error)
NewRenderer creates a new renderer for the given melange configuration
func (*Renderer) GetVariable ¶
GetVariable gets the value of a specific variable
func (*Renderer) GetVariableMap ¶
GetVariableMap returns a copy of the complete variable map
func (*Renderer) RenderConfig ¶
func (r *Renderer) RenderConfig() (*melange.Configuration, error)
RenderConfig creates a new configuration with all variables resolved This is useful when you need a fully rendered config for processing