actions

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Base action

Do a find and replace for a string during a migration

Do a find and replace for a string during a migration

Do a find and replace for a string during a migration

Manipulate a YAML document

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunAction

func RunAction(log *logrus.Entry, globalConfig *configs.GlobalConfig, actionID string, dir string, description string, input map[string]string) error

Types

type ActionRunner

type ActionRunner interface {
	Run(log *logrus.Entry) error
}

type AddFile

type AddFile struct {
	BaseDir string
	NewFile string `fig:"file"`
	Content string `fig:"content"`
}

func NewAddFileAction

func NewAddFileAction(dir string, description string, input map[string]string) *AddFile

func (*AddFile) Run

func (r *AddFile) Run(log *logrus.Entry) error

type Replace

type Replace struct {
	BaseDir   string
	OldString string
	NewString string
	Glob      string
	// contains filtered or unexported fields
}

func NewReplaceAction

func NewReplaceAction(dir string, description string, input map[string]string, ignoreDirs []string) *Replace

func (*Replace) Run

func (r *Replace) Run(log *logrus.Entry) error

type RunCommand

type RunCommand struct {
	BaseDir      string
	Command      string
	GlobalConfig *configs.GlobalConfig
}

func NewRunCommandAction

func NewRunCommandAction(dir string, description string, input map[string]string, globalConfig *configs.GlobalConfig) *RunCommand

func (*RunCommand) Run

func (r *RunCommand) Run(log *logrus.Entry) error

type YAML added in v1.3.0

type YAML struct {
	SubAction string
	Old       string
	New       string
	Glob      string
}

func NewYAMLAction added in v1.3.0

func NewYAMLAction(dir string, description string, input map[string]string) *YAML

func (*YAML) Run added in v1.3.0

func (r *YAML) Run(log *logrus.Entry) error

Run executes the YAML action. It searches for files that match the specified glob pattern, reads each file, unmarshals its content into a YAML document, performs the specified subaction (e.g., delete), and then writes the modified document back to the file. If any errors occur during the process, they are logged and the execution continues with the next file.

Jump to

Keyboard shortcuts

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