cmd

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: PostgreSQL Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuildDate time.Time // Set by main
View Source
var DevMode = false // Whether running in development mode
View Source
var TransqlateVersion string // Set by main
View Source
var Version string // Set by main

Functions

func Errorf

func Errorf(msg string, args ...any) err

Errorf creates a cmd error

Default exit code is 1. Use WithCode(x) to change exit code. You cant wrap an error.

func Exit added in v0.0.12

func Exit(code int) error

Exit returns an anonymous exiting error

Use it to stop program after --version or --help. Using cmd.Exit() rather than os.Exit() ensures all deferred functions are executed.

func Koanf added in v0.0.12

func Koanf(flags *pflag.FlagSet) *koanf.Koanf

Koanf loads flags and environment variables into a koanf instance.

Set defaults in flags.

func NewDriver added in v0.0.12

func NewDriver[T any](json string) (T, error)

NewDriver instantiates migration driver for current project

If json is set to either "Source" or "Driver", NewDriver tries to decode json into driver.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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