codemod

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddImports

func AddImports(path string, deps []string) error

func AddJSONSection

func AddJSONSection(fp, section string, data interface{}) error

func AppendTemplateToFile

func AppendTemplateToFile(path string, t *template.Template, data interface{}) error

func AppendTextToFile

func AppendTextToFile(path, text string) error

func CreateTemplateFile

func CreateTemplateFile(t *template.Template, dest string, data interface{}, overwrite bool) error

func CreateTemplateFiles

func CreateTemplateFiles(templatesFS embed.FS, dest string, params map[string]string, overwrite bool) ([]string, error)

func GetGoModulePath

func GetGoModulePath(projectDir string) (string, error)

func InsertRoute

func InsertRoute(path string, p InsertRouteParams) error

func InsertTemplateToFile

func InsertTemplateToFile(path string, t *template.Template, data interface{}, offset int) error

func InsertTextToFile

func InsertTextToFile(path, text string, offset int) error

func InsertWireModuleItems

func InsertWireModuleItems(filePath, items string) error

Types

type CodeModifier

type CodeModifier interface {
	Name() string
	Apply(ctx context.Context) error
}

type InsertRouteParams

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

Directories

Path Synopsis
base
pkg
storage
sql
web

Jump to

Keyboard shortcuts

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