xgobuild

package
v0.58.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: Apache-2.0 Imports: 30 Imported by: 1

Documentation

Index

Constants

This section is empty.

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 ClassKind

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

func RegisterClassFileType

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

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 *ixgo.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) 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) Release added in v0.57.0

func (p *Context) Release()

Release cleans up package patches by removing temporarily added scope objects. Must be called after finishing work with a Context to restore packages to their original state.

The method is idempotent - multiple calls are safe.

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
gsh
tpl
xgo

Jump to

Keyboard shortcuts

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