Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultFS embed.FS
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct { // Renderer renders the application. Renderer Renderer // Versions are the application versions to be inspected. They will be // passed to the Renderer as the ".Version" field. // // If this is nil, the GoVerions will also be used as the application // versions that are passed to the template. Versions []*version.Version // GoVerions are the versions of Go to build the application with. // // If this is nil, the latest version of Go will be used. GoVerions []*version.Version }
Application is the information about a template application that needs to be inspected for binary data.
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is a cache of struct field offsets.
func NewCache ¶
NewCache loads struct field offsets from offsetFile and returns them as a new Cache.
func (*Cache) GetOffset ¶
func (c *Cache) GetOffset(ver *version.Version, id structfield.ID) (structfield.OffsetKey, bool)
GetOffset returns the cached offset key and true for the id at the specified version is found in the cache. If the cache does not contain a valid offset for the provided values, 0 and false are returned.
type Inspector ¶
Inspector inspects structure of Go packages.
func New ¶
New returns an Inspector that configured to inspect offsets defined in the manifests.
If cache is non-nil, offsets will first be looked up there. Otherwise, the offsets will be found by building the applicatiions in the manifests and inspecting the produced binaries.
func (*Inspector) AddManifest ¶
AddManifest adds the manifest to the Inspector's set of Manifests to inspect.
type Manifest ¶
type Manifest struct { // Application is the application to extract binary data from. Application Application // StructFields are struct fields the application should contain that need // offsets to be found. StructFields []structfield.ID }
Manifest contains all information that needs to be inspected for an application.
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer renders templates from an fs.FS.
func NewRenderer ¶
NewRenderer returns a new *Renderer used to render the template files found in f at the provided src.
If f is nil, DefaultFS will be used instead.