Documentation ¶
Index ¶
- Variables
- func IsNotFound(err error) bool
- type Class
- type MissingError
- type Module
- func (p *Module) ClassKind(fname string) (isProj, ok bool)
- func (p *Module) DepMods() map[string]module.Version
- func (p *Module) ImportClasses(importClass ...func(c *Project)) (err error)
- func (p *Module) IsClass(ext string) (ok bool)
- func (p *Module) IsPkgtStandard(pkgPath string) bool
- func (p *Module) Lookup(pkgPath string) (pkg *Package, err error)
- func (p *Module) LookupClass(ext string) (c *Project, ok bool)
- func (p *Module) LookupDepMod(modPath string) (modVer module.Version, ok bool)
- func (p *Module) PkgId(pkgPath string) (string, error)
- func (p *Module) PkgType(pkgPath string) PkgType
- type Package
- type PkgType
- type Project
Constants ¶
This section is empty.
Variables ¶
var ( SpxProject = &Project{ Ext: ".spx", Class: "Game", PkgPaths: []string{"github.com/goplus/spx", "math"}, Works: []*modfile.Class{{Ext: ".spx", Class: "Sprite"}}, } GshProject = &Project{ Ext: ".gsh", Class: "App", PkgPaths: []string{"github.com/qiniu/x/gsh", "math"}, } TestProject = &Project{ Ext: "_test.gox", Class: "App", PkgPaths: []string{"github.com/goplus/gop/test", "testing"}, Works: []*modfile.Class{{Ext: "_test.gox", Class: "Case"}}, } )
var ( ErrNotFound = mod.ErrNotFound ErrNotClassFileMod = errors.New("not a classfile module") )
var Default = New(modload.Default)
Default represents the default gop.mod object.
var (
ErrInvalidPkgPath = errors.New("invalid package path")
)
Functions ¶
func IsNotFound ¶ added in v0.13.1
IsNotFound returns a boolean indicating whether the error is known to report that a module or package does not exist. It is satisfied by ErrNotFound.
Types ¶
type MissingError ¶ added in v0.9.11
type MissingError struct {
Path string
}
func (*MissingError) Error ¶ added in v0.9.11
func (e *MissingError) Error() string
type Module ¶
func LoadFrom ¶ added in v0.11.9
LoadFrom loads a module from specified go.mod file and an optional gop.mod file.
func LoadMod ¶
LoadMod loads a module from a versioned module path. If we only want to load a Go modfile, pass env parameter as nil.
func (*Module) ClassKind ¶ added in v0.11.1
ClassKind checks a fname is a known classfile or not. If it is, then it checks the fname is a project file or not.
func (*Module) DepMods ¶ added in v0.13.1
DepMods returns all depended modules. If a depended module path is replace to be a local path, it will be canonical to an absolute path.
func (*Module) ImportClasses ¶ added in v0.11.1
ImportClasses imports all classfiles found in this module (from go.mod/gop.mod).
func (*Module) IsPkgtStandard ¶ added in v0.12.2
IsPkgtStandard checks if a pkgPath is Go standard package or not.
func (*Module) LookupClass ¶
LookupClass lookups a classfile by ext.
func (*Module) LookupDepMod ¶
LookupDepMod lookups a depended module. If modVer.Path is replace to be a local path, it will be canonical to an absolute path.