framework

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuildCmd = &cobra.Command{
	Use:   "build",
	Short: "Build the application for production",
	Long: `Build compiles your Velocity application for production deployment.
	
It supports cross-compilation, optimization, and versioning.`,
	Run: func(cmd *cobra.Command, args []string) {
		buildApp()
	},
}

BuildCmd represents the build command

View Source
var MakeControllerCmd = &cobra.Command{
	Use:   "make:controller [name]",
	Short: "Generate a new controller",
	Long: `Generate a new HTTP controller with optional CRUD methods.

Examples:
  velocity make:controller UserController
  velocity make:controller PostController --resource
  velocity make:controller API/ProductController --api`,
	SilenceUsage:  true,
	SilenceErrors: true,
	Args: func(cmd *cobra.Command, args []string) error {
		if len(args) < 1 {
			ui.Error("Controller name is required")
			ui.Newline()
			ui.Muted("Usage: velocity make:controller [name]")
			ui.Newline()
			ui.Muted("Flags:")
			ui.Muted("  --api         Generate API controller (JSON responses)")
			ui.Muted("  --resource    Generate resource controller with CRUD methods")
			ui.Muted("  --methods     Custom methods (comma-separated)")
			return fmt.Errorf("")
		}
		return nil
	},
	Run: func(cmd *cobra.Command, args []string) {
		name := args[0]
		generateController(name)
	},
}

MakeControllerCmd represents the make:controller command

View Source
var MigrateCmd = &cobra.Command{
	Use:   "migrate",
	Short: "Run database migrations",
	Long:  `Run all pending database migrations for your application.`,
	Run: func(cmd *cobra.Command, args []string) {
		runMigrations(false)
	},
}

MigrateCmd represents the migrate command

View Source
var MigrateFreshCmd = &cobra.Command{
	Use:   "migrate:fresh",
	Short: "Drop all tables and re-run migrations",
	Long:  `Drop all database tables and re-run all migrations from scratch.`,
	Run: func(cmd *cobra.Command, args []string) {
		runMigrations(true)
	},
}

MigrateFreshCmd represents the migrate:fresh command

View Source
var ServeCmd = &cobra.Command{
	Use:   "serve",
	Short: "Start the development server",
	Long: `Start the Velocity development server with optional hot reload.
	
The server will automatically reload when Go files change if --watch is enabled.`,
	Run: func(cmd *cobra.Command, args []string) {
		ui.Header("serve")
		if watch {
			ui.Info(fmt.Sprintf("Starting on port %s with hot reload...", ui.Highlight(port)))
		} else {
			ui.Info(fmt.Sprintf("Starting on port %s...", ui.Highlight(port)))
		}
		ui.Newline()

		if watch {
			runWithWatcher()
		} else {
			runServer()
		}
	},
}

ServeCmd represents the serve command

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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