Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileContext ¶
type FileContext struct { // FileContent is the content of the file to be matched. FileContent []byte // PackageName is the name of the package given as seen in `package main` for example. PackageName string // contains filtered or unexported fields }
FileContext is the context for a file to be matched.
func (*FileContext) FileContains ¶
func (ctx *FileContext) FileContains(content string) MatchType
type MatchType ¶
type MatchType byte
MatchType is an enumeration of the possible outcomes of a join point
const ( // Unknown indicates that the join point cannot determine whether it matches the given context Unknown MatchType = '?' // Match indicates that the join point may match the given context Match MatchType = 'Y' // NeverMatch indicates that the join point DOES NOT match the given context NeverMatch MatchType = 'N' )
func (MatchType) And ¶
And returns the logical AND of two MatchType values Truth table:
| A | B | A AND B | |---|---|---------| | N | N | N | | N | ? | N | | N | Y | N | | ? | ? | ? | | ? | Y | ? | | Y | Y | Y |
type PackageContext ¶
type PackageContext struct { // ImportPath is the import path of the package in its module. ImportPath string // ImportMap is the map of import paths to their respective package archives ImportMap map[string]string // TestMain is true if the package is a test package. TestMain bool }
PackageContext is the context for a package to be matched.
func (*PackageContext) PackageImports ¶
func (ctx *PackageContext) PackageImports(path string) MatchType
Click to show internal directories.
Click to hide internal directories.