Documentation ¶
Index ¶
- Variables
- func CephCFunctions(pkg string, ii *Inspector) error
- func CephGoFunctions(source, packageName string, ii *Inspector) error
- func SetLogger(l DebugLogger)
- type CFunction
- type CFunctions
- type DebugLogger
- type Inspector
- type JSONReport
- type NoOpLogger
- type ReportOptions
- type Reporter
- type TextReport
Constants ¶
This section is empty.
Variables ¶
var (
// CastXmlBin is the name/location of the castxml binary.
CastXmlBin = "castxml"
)
Functions ¶
func CephCFunctions ¶
CephCFunctions will extract C functions from the supplied package name and update the results within the code inspector.
func CephGoFunctions ¶
CephGoFunctions will look for C functions called by the code code and update the found functions for the package within the inspector.
func SetLogger ¶
func SetLogger(l DebugLogger)
SetLogger will set the given debug logger for the whole implements package.
Types ¶
type CFunctions ¶
type CFunctions []CFunction
CFunctions is a sortable slice of CFunction.
func (CFunctions) Len ¶
func (cfs CFunctions) Len() int
func (CFunctions) Less ¶
func (cfs CFunctions) Less(i, j int) bool
func (CFunctions) Swap ¶
func (cfs CFunctions) Swap(i, j int)
type DebugLogger ¶
type DebugLogger interface {
Printf(format string, v ...interface{})
}
DebugLogger is a simple interface to allow debug logging w/in the implements package.
type Inspector ¶
type Inspector struct {
// contains filtered or unexported fields
}
Inspector types collect the high-level results from C and Go code scans.
func NewInspector ¶
func NewInspector() *Inspector
NewInspector returns a newly created code inspector object.
func (*Inspector) SetExpected ¶
func (ii *Inspector) SetExpected(prefix string, expected CFunctions) error
SetExpected sets the expected C functions, asuming the supplied prefix.
type JSONReport ¶
type JSONReport struct {
// contains filtered or unexported fields
}
JSONReport is a type that implements the Report interface and generates structured JSON.
func NewJSONReport ¶
func NewJSONReport(o ReportOptions, dest io.Writer) *JSONReport
NewJSONReport creates a new json report. The JSON will be written to the supplied dest when Done is called.
func (*JSONReport) Done ¶
func (r *JSONReport) Done() error
Done completes the JSON report and writes the JSON to the output.
type NoOpLogger ¶
type NoOpLogger struct{}
NoOpLogger is a dummy logger that generates no output.
func (NoOpLogger) Printf ¶
func (NoOpLogger) Printf(_ string, _ ...interface{})
Printf implements the DebugLogger interface.
type ReportOptions ¶
ReportOptions is a common set of options for reports.
type Reporter ¶
type Reporter interface { // Report reports on the given (sub)package with the given inspector's // contents. Report(string, *Inspector) error // Done flushes any buffered state between calls to Report. Done() error }
Reporter is a common interface to report on the "implements" analysis.
type TextReport ¶
type TextReport struct {
// contains filtered or unexported fields
}
TextReport implements a streaming plain-text output report.
func NewTextReport ¶
func NewTextReport(o ReportOptions, dest io.Writer) *TextReport
NewTextReport creates a new TextReport.