package facts
import "gvisor.dev/gvisor/tools/nogo/facts"
Package facts implements alternate fact types.
Index ¶
- type Bundle
- func BundleFrom(filename string) (*Bundle, error)
- func NewBundle() *Bundle
- func (b *Bundle) Add(path string, facts *Package)
- func (b *Bundle) Package(pkg *types.Package) (*Package, error)
- func (b *Bundle) Serialize(w io.Writer) error
- type Package
- func NewPackage() *Package
- func (p *Package) ExportFact(obj types.Object, ptr analysis.Fact)
- func (p *Package) ImportFact(obj types.Object, ptr analysis.Fact) bool
- func (p *Package) ReadFrom(pkg *types.Package, r io.Reader) error
- func (p *Package) Serialize(w io.Writer) error
- type Serializer
Types ¶
type Bundle ¶
type Bundle struct {
// contains filtered or unexported fields
}
Bundle is a set of facts about different packages.
This is used to serialize a collection of facts about different packages, which will be loaded and evaluated lazily.
func BundleFrom ¶
BundleFrom may be used to create a new bundle that deserializes the contents of the given file.
Note that there is no explicit close mechanism, and the underlying file will be closed only when the object is finalized.
func NewBundle ¶
func NewBundle() *Bundle
NewBundle makes a new package bundle.
func (*Bundle) Add ¶
Add adds the package to the Bundle.
func (*Bundle) Package ¶
Package looks up the given package in the bundle.
func (*Bundle) Serialize ¶
Serialize implements Serializer.Serialize.
type Package ¶
Package is a set of facts about a single package.
These use the types.Object as the key because this is canonical. Normally, this is canonical only in the context of a single types.Package. However, because all imports are shared across all packages, there is a single canonical types.Object shared among all packages being analyzed.
func NewPackage ¶
func NewPackage() *Package
NewPackage returns a new set of Package facts.
func (*Package) ExportFact ¶
ExportFact exports an object fact.
func (*Package) ImportFact ¶
ImportFact imports an object fact.
func (*Package) ReadFrom ¶
ReadFrom deserializes a package.
func (*Package) Serialize ¶
Serialize implements Serializer.Serialize.
type Serializer ¶
Serializer is used for fact serialization.
It generalizes over the Package and Bundle types.
Source Files ¶
facts.go
- Version
- v0.0.0-20250617221512-95d875276806 (latest)
- Published
- Jun 17, 2025
- Platform
- linux/amd64
- Imports
- 9 packages
- Last checked
- 11 hours ago –
Tools for package owners.