codemod

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataExtractorFn added in v1.2.1

type DataExtractorFn func(wd string) (map[string]string, error)

func ExtractGoModulePath added in v1.2.1

func ExtractGoModulePath() DataExtractorFn

type Dir added in v1.2.1

type Dir struct {
	// contains filtered or unexported fields
}

func OpenDir added in v1.2.1

func OpenDir(wd string) *Dir

func (*Dir) Apply added in v1.2.1

func (d *Dir) Apply(fn ...DirFn) *Dir

func (*Dir) Cd added in v1.2.1

func (d *Dir) Cd(wd string) *Dir

func (*Dir) CdAbs added in v1.2.1

func (d *Dir) CdAbs(wd string) *Dir

func (*Dir) Done added in v1.2.1

func (d *Dir) Done() error

func (*Dir) ExtractData added in v1.2.1

func (d *Dir) ExtractData(fn DataExtractorFn) *Dir

func (*Dir) ModifyData added in v1.2.1

func (d *Dir) ModifyData(fn func(data map[string]string)) *Dir

func (*Dir) OpenFile added in v1.2.1

func (d *Dir) OpenFile(fp string) *File

type DirFn added in v1.2.1

type DirFn func(wd string, data map[string]string) error

func CreateTemplateFiles

func CreateTemplateFiles(templatesFS fs.FS, data map[string]string, overwrite bool) DirFn

func RemoveFile added in v1.2.1

func RemoveFile(fp string) DirFn

func RenameFile added in v1.2.1

func RenameFile(old, new string) DirFn

func RunCmd added in v1.2.1

func RunCmd(name string, arg ...string) DirFn

type File added in v1.2.1

type File struct {
	// contains filtered or unexported fields
}

func (*File) Apply added in v1.2.1

func (f *File) Apply(fn ...FileFn) *File

func (*File) Close added in v1.2.1

func (f *File) Close() *Dir

func (*File) CloseAndDone added in v1.2.1

func (f *File) CloseAndDone() error

func (*File) CloseAndOpen added in v1.2.1

func (f *File) CloseAndOpen(fp string) *File

type FileFn added in v1.2.1

type FileFn func(contents string, data map[string]string) (string, error)

func AddGoImports added in v1.2.1

func AddGoImports(imports []string) FileFn

func AddJSONSection

func AddJSONSection(section string, sectionContents interface{}) FileFn

func AddProviderToWireSet added in v1.2.1

func AddProviderToWireSet(provider string) FileFn

func AppendText added in v1.2.1

func AppendText(text string) FileFn

func InsertCHTTPRoute added in v1.2.1

func InsertCHTTPRoute(p InsertCHTTPRouteParams) FileFn

func InsertLineAfter added in v1.2.1

func InsertLineAfter(find, insert string) FileFn

func InsertText added in v1.2.1

func InsertText(text string, offset int) FileFn

func ReplaceRegex added in v1.2.1

func ReplaceRegex(expr, text string) FileFn

type InsertCHTTPRouteParams added in v1.2.1

type InsertCHTTPRouteParams struct {
	Path        string
	Method      string
	HandlerName string
	HandlerBody string
}

Jump to

Keyboard shortcuts

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