parser

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: May 28, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const GoneModule = "github.com/gone-io/gone/v2"
View Source
const LoaderFile = "module.load.go"

Variables

This section is empty.

Functions

func GetDependentModuleAbsPath

func GetDependentModuleAbsPath(module string) (string, error)

func GetDirPackageName

func GetDirPackageName(dir string) string

GetDirPackageName get package name of dir path

Types

type Import

type Import struct {
	Alias   string
	PkgName string
	PkgID   string
}

type LoadFunc

type LoadFunc struct {
	Name    string
	PkgID   string
	PkgName string
	Comment string
}

func (LoadFunc) ID

func (l LoadFunc) ID() string

func (LoadFunc) String

func (l LoadFunc) String() string

type LoaderParser

type LoaderParser struct {
	Imports []*Import
	// contains filtered or unexported fields
}

func New

func New(workDir string, module string) (*LoaderParser, error)

func (*LoaderParser) Execute

func (s *LoaderParser) Execute(cmdSelected []string, onlyPrint bool) error

func (*LoaderParser) GenerateCode

func (s *LoaderParser) GenerateCode() (importCode, loadFuncCode string)

func (*LoaderParser) Init

func (s *LoaderParser) Init() error

func (*LoaderParser) ParseImports

func (s *LoaderParser) ParseImports()

func (*LoaderParser) ParseLoadFuncs

func (s *LoaderParser) ParseLoadFuncs()

func (*LoaderParser) ParseModuleLoader

func (s *LoaderParser) ParseModuleLoader() (loaders []*LoadFunc, err error)

func (*LoaderParser) Save

func (s *LoaderParser) Save(importCode, loadFuncCode string) error

func (*LoaderParser) Select

func (s *LoaderParser) Select(options []*LoadFunc, cmdSelected []string) error

Jump to

Keyboard shortcuts

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