cmd

package
v0.0.0-...-75a9be3 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MigrateCmd = &cobra.Command{
		Use:   "migrate",
		Short: "Migrate the database",
		RunE: func(_ *cobra.Command, _ []string) error {
			config, err := LoadConfig()
			if err != nil {
				return err
			}

			postgres := pgx.Postgres{}
			driver, err := postgres.Open(config.PostgresConn)
			if err != nil {
				return err
			}
			defer driver.Close()

			return storage.EnsureMigrationsDone(driver, "boilerplate")
		},
	}
)
View Source
var Version = "0.0.1"

Functions

func Execute

func Execute()

Types

type Config

type Config struct {
	ServerAddr string

	PostgresConn string
	RedisConn    string
}

func LoadConfig

func LoadConfig() (Config, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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