Documentation
¶
Overview ¶
Package generate The purpose of this package is to ensure that we can extend the use-case of P2PRC. We will create a project directory with the template to extend the use-case of P2PRC
Index ¶
- func CreateFolder(name string, path string) error
- func GenerateNewProject(name string, module string) error
- type NewProject
- func (a *NewProject) ChangeImportFiles() error
- func (np *NewProject) ChangeImports(CurrentImport string, ChangedImport string) error
- func (a *NewProject) CreateGoMod() error
- func (a *NewProject) CreateGoModTidy() error
- func (np *NewProject) GetASTGoFile() error
- func (a *NewProject) GetCurrentGoModule() error
- func (a *NewProject) GitAdd() error
- func (a *NewProject) GitCommit() error
- func (np *NewProject) WriteGoAst() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFolder ¶
CreateFolder Creates a new folder based on the name and path provided
func GenerateNewProject ¶
GenerateNewProject creates a new copy of the P2PRC project for custom modification
Types ¶
type NewProject ¶
type NewProject struct { Name string Module string NewDir string P2PRCPath string CurrentModule string Option *copy.Options Token *token.FileSet AST *ast.File FileNameAST string }
NewProject Struct information required when creating a new project
func (*NewProject) ChangeImportFiles ¶
func (a *NewProject) ChangeImportFiles() error
ChangeImportFiles Changes Appropriate imports in the appropriate file
func (*NewProject) ChangeImports ¶
func (np *NewProject) ChangeImports(CurrentImport string, ChangedImport string) error
ChangeImports Changes import of the AST
func (*NewProject) CreateGoMod ¶
func (a *NewProject) CreateGoMod() error
CreateGoMod Creates a new go module for the new project created
func (*NewProject) CreateGoModTidy ¶
func (a *NewProject) CreateGoModTidy() error
func (*NewProject) GetASTGoFile ¶
func (np *NewProject) GetASTGoFile() error
GetASTGoFile Gets AST of the Go file provided
func (*NewProject) GetCurrentGoModule ¶
func (a *NewProject) GetCurrentGoModule() error
GetCurrentGoModule Gets the current go module name
func (*NewProject) GitAdd ¶
func (a *NewProject) GitAdd() error
func (*NewProject) GitCommit ¶
func (a *NewProject) GitCommit() error
func (*NewProject) WriteGoAst ¶
func (np *NewProject) WriteGoAst() error
WriteGoAst Write changed imports back to the AST