cmd

package
v5.3.3-pre23 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: AGPL-3.0 Imports: 44 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ExitCodeStopFailed     = 2
	ExitCodeShutdownFailed = 4
	ExitCodeDefaultError   = 3
	ExitCodeSelfRestart    = 124
)

Variables

View Source
var InitDBConfig = &sdb.DB{
	Type:     `mysql`,
	User:     `root`,
	Database: `nging`,
	Host:     `127.0.0.1:3306`,
}

静默安装

View Source
var InitInstallConfig = &struct {
	Charset        string
	AdminUser      string
	AdminPass      string
	AdminEmail     string
	Language       string // en / zh-cn
	AdminPwdRandom bool
}{
	Charset:   sdb.MySQLDefaultCharset,
	AdminUser: `admin`,
	Language:  `zh-cn`,
}
View Source
var ServiceOptions = &service.Options{
	Name:          ``,
	DisplayName:   ``,
	Description:   ``,
	Options:       map[string]interface{}{},
	MaxRetries:    10,
	RetryInterval: 60,
}

ServiceOptions 服务选项

Functions

func Add

func Add(cmds ...*cobra.Command)

func BuildTranslator

func BuildTranslator(c language.Config) *language.Translate

func CallSignalOperation added in v5.2.0

func CallSignalOperation(sig os.Signal, i int, eng engine.Engine)

func Execute

func Execute()

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

func FetchFont

func FetchFont(_cssFile string, _outputDir string, _debug bool) error

func GetTranslator

func GetTranslator() *language.Translate

func Init

func Init()

func NewContext

func NewContext() echo.Context

func NewRoot

func NewRoot() *cobra.Command

func RegisterSignal added in v5.2.0

func RegisterSignal(s os.Signal, op ...func(int, engine.Engine, int))

func ResetTranslator

func ResetTranslator()

func SendSignal added in v5.2.6

func SendSignal(sig os.Signal, exitCode int)

func TestSuiteRegister

func TestSuiteRegister(name string, fn func(cmd *cobra.Command, args []string) error)

Types

type ExitCoder added in v5.2.6

type ExitCoder interface {
	ExitCode() int
}

type SignalWithExitCode added in v5.2.6

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

func NewSignalWithExitCode added in v5.2.6

func NewSignalWithExitCode(sig os.Signal, exitCode int) SignalWithExitCode

func (SignalWithExitCode) ExitCode added in v5.2.6

func (s SignalWithExitCode) ExitCode() int

func (SignalWithExitCode) Signal added in v5.2.6

func (s SignalWithExitCode) Signal()

func (SignalWithExitCode) String added in v5.2.6

func (s SignalWithExitCode) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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