Documentation
¶
Overview ¶
Package contractscan discovers runtime contract registrations in normal Go source using the standard Go AST.
Index ¶
Constants ¶
View Source
const RuntimeImportPath = "github.com/cssbruno/gowdk/runtime/contracts"
Variables ¶
This section is empty.
Functions ¶
func LinkReferences ¶
func LinkReferences(refs []gwdkir.ContractReference, report Report) []gwdkir.ContractReference
Types ¶
type Contract ¶
type Contract struct {
Kind runtimecontracts.Kind `json:"kind"`
EventCategory runtimecontracts.EventCategory `json:"eventCategory,omitempty"`
Package string `json:"package,omitempty"`
Type string `json:"type"`
TypeImportPath string `json:"typeImportPath,omitempty"`
Result string `json:"result,omitempty"`
ResultImportPath string `json:"resultImportPath,omitempty"`
Handler string `json:"handler,omitempty"`
Register string `json:"register,omitempty"`
InputFields []manifest.BackendInputField `json:"inputFields,omitempty"`
Emits []EventRef `json:"emits,omitempty"`
Roles []string `json:"roles,omitempty"`
Source string `json:"source"`
Line int `json:"line"`
Column int `json:"column"`
}
Contract describes one discovered registration call.
type Diagnostic ¶
type Diagnostic struct {
Severity string `json:"severity"`
Code string `json:"code,omitempty"`
Kind runtimecontracts.Kind `json:"kind,omitempty"`
Package string `json:"package,omitempty"`
Type string `json:"type,omitempty"`
TypeImportPath string `json:"typeImportPath,omitempty"`
Handler string `json:"handler,omitempty"`
Source string `json:"source"`
Line int `json:"line"`
Column int `json:"column"`
Message string `json:"message"`
}
Diagnostic describes a validation issue found while scanning contracts.
type EventRef ¶
type EventRef struct {
Category runtimecontracts.EventCategory `json:"category"`
Type string `json:"type"`
TypeImportPath string `json:"typeImportPath,omitempty"`
}
EventRef describes one event a command handler can emit.
type Report ¶
type Report struct {
Version int `json:"version"`
Root string `json:"root"`
Contracts []Contract `json:"contracts"`
Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
}
Report is the full discovery output.
Click to show internal directories.
Click to hide internal directories.