config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Activity

type Activity struct {
	Database     string         `yaml:"database" json:"database"`
	Tables       ActivityTables `yaml:"tables" json:"tables"`
	Format       ExporterName   `yaml:"format" json:"format"`
	TablePerFile bool           `yaml:"table_per_file" json:"table_per_file"`
	SkipExists   bool           `yaml:"skip_exists" json:"skip_exists"`
	Out          struct {
		Dir        string `yaml:"dir" json:"dir"`
		FilePrefix string `yaml:"file_prefix" json:"file_prefix"`
	} `yaml:"out" json:"out"`
	Spec interface{} `yaml:"-" json:"spec"`
}

func (*Activity) UnmarshalYAML

func (s *Activity) UnmarshalYAML(n *yaml.Node) error

type ActivityTables

type ActivityTables struct {
	List   specw.EnvStrings `yaml:"list" json:"list"`
	Prefix string           `yaml:"prefix" json:"prefix"`
}

type Commit

type Commit struct {
	Message string                         `yaml:"message" json:"message"`
	Author  *specw.Env[specw.GitCommitter] `yaml:"author" json:"author"`
	Push    bool                           `yaml:"push" json:"push"`
}

func (*Commit) Valid

func (c *Commit) Valid() bool

type Config

type Config struct {
	Databases map[string]schema.Database `yaml:"databases" json:"databases"`
	Tasks     map[string]Task            `yaml:"tasks" json:"tasks"`
	Options   struct {
		WithMigrationsTable bool `yaml:"with_migrations_table" json:"with_migrations_table"`
		NoPrintStat         bool `yaml:"no_print_stat" json:"no_print_stat"`
		Debug               bool `yaml:"debug" json:"debug"`
	} `yaml:"options"`
}

func (*Config) GetDefaultDatabaseName

func (c *Config) GetDefaultDatabaseName() (string, bool)

func (*Config) UsingDatabases

func (c *Config) UsingDatabases() map[string]schema.Database

type ExpectingDatabaseDriver

type ExpectingDatabaseDriver interface {
	InjectDatabaseDriver(driver schema.DatabaseDriver)
}

type ExporterName

type ExporterName string
const (
	ExporterNameMd                   ExporterName = "md"
	ExporterNameDiagram              ExporterName = "diagram"
	ExporterNameGoEntities           ExporterName = "go-entities"
	ExporterNameGoEntityRepository   ExporterName = "go-entity-repository"
	ExporterNameGoose                ExporterName = "goose"
	ExporterNameGooseFixtures        ExporterName = "goose-fixtures"
	ExporterNameGoSQLMigrate         ExporterName = "go-sql-migrate"
	ExporterNameDDL                  ExporterName = "ddl"
	ExporterNameLaravelMigrationsRaw ExporterName = "laravel-migrations-raw"
	ExporterNameLaravelModels        ExporterName = "laravel-models"
	ExporterNameGrpcCrud             ExporterName = "grpc-crud"
	ExporterNameCSV                  ExporterName = "csv"
	ExporterNameJSONSchema           ExporterName = "json-schema"
	ExporterNameGraphql              ExporterName = "graphql"
	ExporterNameDBML                 ExporterName = "dbml"
	ExporterNameCustom               ExporterName = "custom"
	ExporterNameMermaid              ExporterName = "mermaid"
)

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

func NewLoader

func NewLoader(
	files fs.Driver,
	parsers map[string]Parser,
) *Loader

func (*Loader) Load

func (l *Loader) Load(path string) (*Config, error)

type Parser

type Parser func(content []byte) (*Config, error)

func JSONParser

func JSONParser() Parser

func YAMLParser

func YAMLParser() Parser

type Task

type Task struct {
	Activities []Activity `yaml:"activities" json:"activities"`
	Commit     Commit     `yaml:"commit" json:"commit"`
}

type ValidatableSpec

type ValidatableSpec interface {
	Validate() error
}

Jump to

Keyboard shortcuts

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