replace

package
v0.7.9 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Path string `cfg:"path"`
	// SkipFiles is the files to skip, use glob pattern.
	SkipFiles []string `cfg:"skip_files"`
	// SkipDirs is the dirs to skip.
	SkipDirs []string  `cfg:"skip_dirs"`
	Contents []Content `cfg:"contents"`
}

func (*Config) Run

func (c *Config) Run(ctx context.Context) error

type Content

type Content struct {

	// Regex is the regex to match the content.
	//  - If regex is not empty, Old will be ignored.
	Regex string `cfg:"regex"`
	// Old is the old content to replace.
	Old string `cfg:"old"`

	New string `cfg:"new"`

	// Value from load name, key value and type is map[string]interface{}
	Value string `cfg:"value"`
	// contains filtered or unexported fields
}

func (*Content) Check

func (c *Content) Check(v bool)

Jump to

Keyboard shortcuts

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