cmd

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InitCmd = &cobra.Command{
	Use:   "init",
	Short: "初始化服务",
	Long:  `初始化admin用户相关基础信息`,
	RunE: func(cmd *cobra.Command, args []string) error {

		if err := loadGlobalConfig(confType); err != nil {
			return err
		}

		if err := loadGlobalLogger(); err != nil {
			return err
		}

		if err := loadCache(); err != nil {
			return err
		}

		app.InitAllApp()

		initer, err := NewInitialerFromCLI()
		if err != nil {
			return err
		}
		if err := initer.Run(); err != nil {
			return err
		}
		return nil
	},
}

InitCmd 初始化系统

View Source
var RootCmd = &cobra.Command{
	Use:   "keyauth",
	Short: "keyauth 分布式微服务认证与鉴权中心",
	Long:  `keyauth ...`,
	RunE: func(cmd *cobra.Command, args []string) error {
		if vers {
			fmt.Println(version.FullVersion())
			return nil
		}
		return errors.New("no flags find")
	},
}

RootCmd represents the base command when called without any subcommands

Functions

func Execute

func Execute()

Execute adds all child commands to the root command sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

type Initialer

type Initialer struct {
	// contains filtered or unexported fields
}

Initialer 初始化控制器

func NewInitialer added in v0.2.0

func NewInitialer() *Initialer

NewInitialer todo

func NewInitialerFromCLI

func NewInitialerFromCLI() (*Initialer, error)

NewInitialerFromCLI 初始化

func (*Initialer) Run

func (i *Initialer) Run() error

Run 执行初始化

Jump to

Keyboard shortcuts

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