Documentation
¶
Overview ¶
Package embedpkg loads imports and files using the embed Go package.
More specifically, the GX source files of a GX package are embedded into a matching Go package. This process is done by google3/third_party/gxlang/gx/golang/packager/packager using the embed package from the Go standard library. These GX-Go packages are then statically linked into the binary.
At runtime, all GX packages are registered at startup using this package. When a GX package is imported, the embedded source code is compiled into the GX intermediate representation and returned to the caller.
This intermediate representation can be compiled for a specific device by the GX interpreter or can be used to generate bindings for a given language.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBuilder ¶
NewBuilder returns a builder loading GX files from the files embedded in the binary.
func RegisterPackage ¶
RegisterPackage registers the build function of a package given its path.
Types ¶
type BuildFunc ¶
BuildFunc defines the function that a Go library packaging GX files needs to implement.