xgobuild

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 29 Imported by: 8 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// StaticLoad is a mode flag that disables dynamic Importer creation.
	// When StaticLoad is set, the Context will use only the base Loader
	// for package imports instead of creating a dynamic ixgo.Importer.
	// This mode is useful for scenarios where all packages are pre-loaded
	// or when dynamic importing is not needed.
	StaticLoad = ixgo.LastMode * 2
	// NormalizeExport is a mode flag that normalizes package patch exports.
	// When NormalizeExport is set, objects from package patches are re-exported
	// with the base package as their owner, rather than the patch package.
	// This allows patch symbols to appear as if they belong to the original package
	// (e.g., gsh.Point instead of gsh@patch.Point), providing a cleaner API.
	NormalizeExport = ixgo.LastMode * 4
)

Variables

This section is empty.

Functions

func BuildDir

func BuildDir(ctx *ixgo.Context, dir string) (data []byte, err error)

func BuildFSDir

func BuildFSDir(ctx *ixgo.Context, fs parser.FileSystem, dir string) (data []byte, err error)

func BuildFile

func BuildFile(ctx *ixgo.Context, filename string, src interface{}) (data []byte, err error)

func ClassInfo added in v1.1.4

func ClassInfo(fname string) (autoLambdas map[string]int, isProj, ok bool)

func ClassKind

func ClassKind(fname string) (isProj, ok bool)

func RegisterClassFileType

func RegisterClassFileType(ext string, class string, works []*modfile.Class, pkgPaths ...string) *modfile.Project

func RegisterPackagePatch

func RegisterPackagePatch(ctx *ixgo.Context, path string, src interface{}) error

func RegisterProject

func RegisterProject(proj *modfile.Project)

Types

type Class

type Class = modfile.Class

type Context

type Context struct {
	Context  *ixgo.Context
	FileSet  *token.FileSet
	Importer types.Importer
	Loader   ixgo.Loader
	// contains filtered or unexported fields
}

func NewContext

func NewContext(ctx *ixgo.Context) *Context

func (*Context) Import

func (c *Context) Import(path string) (*types.Package, error)

func (*Context) LoadPackages added in v1.0.6

func (c *Context) LoadPackages(apkgs map[string]*ast.Package) (*Package, error)

func (*Context) ParseDir

func (c *Context) ParseDir(dir string) (*Package, error)

func (*Context) ParseFSDir

func (c *Context) ParseFSDir(fs parser.FileSystem, dir string) (*Package, error)

func (*Context) ParseFile

func (c *Context) ParseFile(fname string, src interface{}) (*Package, error)

func (*Context) ParseFiles added in v1.0.6

func (c *Context) ParseFiles(files []string) (*Package, error)

type Import

type Import = modfile.Import

type Package

type Package struct {
	Fset *token.FileSet
	Pkgs []*gogen.Package
}

func (*Package) ForEachFile

func (p *Package) ForEachFile(fn func(pkg *gogen.Package, fname string))

func (*Package) MainPkg

func (p *Package) MainPkg() *gogen.Package

func (*Package) ToAst

func (p *Package) ToAst() (*goast.File, error)

func (*Package) ToSource

func (p *Package) ToSource() ([]byte, error)

type Project

type Project = modfile.Project

Directories

Path Synopsis
pkg
dql
gsh
tpl
xgo

Jump to

Keyboard shortcuts

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