scanner

package
v1.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 9 Imported by: 0

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 New

func New(verbose bool) *Scanner

New creates a new Scanner with optional verbose logging.

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) ScanYAMLModules

func (s *Scanner) ScanYAMLModules() ([]SchemaFile, error)

ScanYAMLModules discovers YAML 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 YAML).

const (
	SchemaTypeSQL  SchemaType = "sql"
	SchemaTypeYAML SchemaType = "yaml"
)

SchemaType constants enumerate the supported schema file formats.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL