Documentation
¶
Overview ¶
Package scanner provides utilities for discovering schema files within Go module directories.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner discovers schema files within a Go module directory tree.
func (*Scanner) ResolveModulePath ¶ added in v1.14.0
ResolveModulePath looks up a module by name (without version) by parsing go.mod to find the version, then resolving to a filesystem path via the module cache or workspace overrides.
func (*Scanner) ScanModules ¶
func (s *Scanner) ScanModules() ([]SchemaFile, error)
ScanModules discovers SQL schema files in the current module directory.
func (*Scanner) ScanModulesWithType ¶
func (s *Scanner) ScanModulesWithType(schemaType SchemaType) ([]SchemaFile, error)
ScanModulesWithType discovers schema files of the specified type in the current module directory.
func (*Scanner) ScanStarlarkModules ¶ added in v1.13.0
func (s *Scanner) ScanStarlarkModules() ([]SchemaFile, error)
ScanStarlarkModules discovers Starlark schema files in the current module directory.
type SchemaFile ¶
type SchemaFile struct {
ModulePath string
FilePath string
Content string
HasMarker bool
Type SchemaType
}
SchemaFile represents a discovered schema file along with its module path and content.
type SchemaType ¶
type SchemaType string
SchemaType identifies the format of a discovered schema file (SQL or Starlark).
const ( SchemaTypeSQL SchemaType = "sql" SchemaTypeStarlark SchemaType = "starlark" )
SchemaType constants enumerate the supported schema file formats.