Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Analyzer ¶
type Analyzer interface { // Analyze executes the analysis function. Analyze(context.Context, *Pass) error }
An Analyzer describes a migration file analyzer.
type Change ¶
type Change struct { schema.Changes // The actual changes. Stmt string // The SQL statement generated this change. Pos int // The position of the statement in the file. }
A Change in a migration file.
type Diagnostic ¶
A Diagnostic is a message associated with a source location or range.
type File ¶
type File struct { migrate.File // Changes is the list of changes this file represents. Changes []*Change }
File represents a parsed version of a migration file.
type Pass ¶
type Pass struct { // A migration file and the changes it describes. File *File // Dev is a driver-specific environment used to execute analysis work. Dev *sqlclient.Client // Report reports a diagnostic Report Reporter }
A Pass provides information to the Run function that applies a specific analyzer to an SQL file.
type Reporter ¶
type Reporter interface {
Report(Diagnostic)
}
Reporter represents a diagnostic reporter.
var NopReporter Reporter = ReporterFunc(func(Diagnostic) {})
NopReporter is a Reporter that does nothing.
type ReporterFunc ¶
type ReporterFunc func(Diagnostic)
ReporterFunc is a function that implements Reporter.
Click to show internal directories.
Click to hide internal directories.