cmd

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package cmd 存放程序的所有子命令

Index

Constants

This section is empty.

Variables

Env 存储全局选项 --env 的值

Functions

func CmdInitConfig

func CmdInitConfig() *cobra.Command

CmdInitConfig @Description 生成配置文件初始化命令 @Author CuratorC 2026-03-17 17:59:01 @Return *cobra.Command

func CmdMigrate

func CmdMigrate() *cobra.Command

CmdMigrate 返回迁移相关的 Cobra 命令组 使用方式:rootCmd.AddCommand(CmdMigrate())

func RegisterDefaultCmd

func RegisterDefaultCmd(rootCmd *cobra.Command, subCmd *cobra.Command)

RegisterDefaultCmd 注册默认命令

func RegisterGlobalFlags

func RegisterGlobalFlags(rootCmd *cobra.Command)

RegisterGlobalFlags 注册全局选项(flag)

func SetGetDBFunc

func SetGetDBFunc(fn GetDBFunc)

SetGetDBFunc 设置获取数据库连接的函数

Types

type GetDBFunc

type GetDBFunc func(dbName string) *database.DB

GetDBFunc 从容器获取数据库连接的函数类型 消费方需要提供此函数,按数据源名称返回对应的 *database.DB

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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