replacer

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReplaceFileContent

func ReplaceFileContent(filePath, newContent string) error

ReplaceFileContent replaces the file contents.

func ReplaceText

func ReplaceText(source string, occurences scanner.Occurences, replacementVariants casing.Variants) string

ReplaceText teplaces all occurences with their replacement variants Occurences should be ordered by StartIndex.

Types

type RenameFunc

type RenameFunc func(oldPath, newPath string) error

RenameFunc describes a function used to rename a file/folder.

type ReplaceFileFunc

type ReplaceFileFunc func(filePath, newContent string) error

ReplaceFileFunc describes a function used to replace the contents of a file.

type TotalRenameResult

type TotalRenameResult struct {
	OccurencesRenamed int
}

TotalRenameResult describes the result of calling TotalRename

func TotalRename

func TotalRename(groups scanner.OccurenceGroups, replacement string, rename RenameFunc, replaceFile ReplaceFileFunc) (*TotalRenameResult, error)

TotalRename will rename files and paths.

Jump to

Keyboard shortcuts

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