app

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package app provides CLI wiring and process setup for gormdb2struct.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, args []string) error

Run executes the gormdb2struct CLI against the provided process arguments.

Types

type CLIConfig

type CLIConfig struct {
	Logging    LoggingConfig `embed:""`
	ConfigPath string        `arg:"" optional:"" name:"config" help:"Path to the TOML configuration file." type:"path"`
}

CLIConfig defines the top-level command-line contract.

type ConvertConfigCmd added in v1.2.0

type ConvertConfigCmd struct {
	ConfigPath string `arg:"" name:"config" help:"Path to the config file to convert." type:"path"`
	Out        string `name:"out" short:"o" default:"" help:"Write the converted config to this path instead of stdout." type:"path"`
	InPlace    bool   `name:"in-place" help:"Overwrite the input config file with the converted format."`
}

ConvertConfigCmd loads any supported config and emits the canonical ConfigVersion=1 TOML format. This command is intentionally hidden from normal help output and exists as a migration utility.

type GenerateConfigSampleCmd

type GenerateConfigSampleCmd struct {
	Out string `name:"out" short:"o" default:"gormdb2struct-sample.toml" help:"Path to write the sample TOML config." type:"path"`
}

GenerateConfigSampleCmd writes a starter TOML configuration file.

type InspectCmd added in v1.1.0

type InspectCmd struct {
	Logging    LoggingConfig `embed:""`
	ConfigPath string        `arg:"" name:"config" help:"Path to the TOML configuration file." type:"path"`
	Format     string        `name:"format" enum:"text,toml" default:"text" help:"Output format for the inspection report."`
}

InspectCmd analyzes a schema and recommends missing type mappings.

type InspectPostgreSQLCmd added in v1.1.0

type InspectPostgreSQLCmd struct {
	Logging               LoggingConfig `embed:""`
	Host                  string        `name:"host" required:"" help:"PostgreSQL host."`
	Port                  int           `name:"port" default:"5432" help:"PostgreSQL port."`
	Database              string        `name:"database" required:"" help:"PostgreSQL database name."`
	User                  string        `name:"user" required:"" help:"PostgreSQL user."`
	Password              string        `name:"password" help:"PostgreSQL password."`
	PasswordEnv           string        `name:"password-env" help:"Environment variable that contains the PostgreSQL password."`
	PasswordStdin         bool          `name:"password-stdin" help:"Read the PostgreSQL password from stdin."`
	PasswordPrompt        bool          `name:"password-prompt" help:"Prompt securely for the PostgreSQL password."`
	SSLMode               bool          `name:"sslmode" help:"Require SSL for the PostgreSQL connection."`
	Objects               []string      `name:"object" help:"Database object to inspect. Repeat to limit the inspection scope."`
	ImportPackagePaths    []string      `` /* 152-byte string literal not displayed */
	Out                   string        `` /* 149-byte string literal not displayed */
	OutPath               string        `name:"out-path" default:"./generated" help:"OutPath to use in TOML output."`
	OutPackagePath        string        `name:"out-package-path" default:"" help:"OutPackagePath to use in TOML output."`
	GeneratedTypesPackage string        `` /* 129-byte string literal not displayed */
	GeneratedTypesPath    string        `` /* 134-byte string literal not displayed */
}

InspectPostgreSQLCmd analyzes a PostgreSQL schema directly from CLI connection flags.

type LoggingConfig

type LoggingConfig struct {
	Level string `name:"logging.level" enum:"debug,info,warn,error" default:"info" help:"Log level." group:"logging"`
}

LoggingConfig defines CLI-controlled logging options.

Directories

Path Synopsis
Package consts stores application-level build and naming constants.
Package consts stores application-level build and naming constants.

Jump to

Keyboard shortcuts

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