示例#1
0
func registerPasswordCommandParamsWithPassgoRegistrar(passgo *app.App) *app.App {
	pLength := password.NewLength()
	pLength.Set("10")
	passgo.Register(pLength.Name(), pLength)

	noSymbols := password.NewNoSymbols()
	passgo.Register(noSymbols.Name(), noSymbols)

	return passgo
}
示例#2
0
文件: password.go 项目: sdaros/passgo
// NewPassword returns a password command with default values.
func NewPassword() *Password {
	password := &Password{
		name:           "password",
		noSymbols:      password.NewNoSymbols(),
		passwordLength: password.NewLength(),
		App:            app.Null(),
	}
	password.execute = passwordExecuteFn(password)
	return password
}
示例#3
0
文件: generate.go 项目: sdaros/passgo
// NewGenerate returns a secret with default values
func NewGenerate() *Generate {
	generate := &Generate{
		App:            app.Null(),
		name:           "generate",
		noSymbols:      password.NewNoSymbols(),
		passwordLength: password.NewLength(),
		url:            generate.NewUrl(),
		userName:       generate.NewUserName(),
	}
	generate.execute = generateExecuteFn(generate)
	return generate
}
示例#4
0
func registerGenerateCommandFlagsWithPassgoRegistrar(passgo *app.App) *app.App {
	url := generate.NewUrl()
	url.Set("https://cip.li")
	passgo.Register(url.Name(), url)

	userName := generate.NewUserName()
	userName.Set("zap_rowsdower")
	passgo.Register(userName.Name(), userName)

	pLength := password.NewLength()
	pLength.Set("10")
	passgo.Register(pLength.Name(), pLength)

	noSymbols := password.NewNoSymbols()
	passgo.Register(noSymbols.Name(), noSymbols)

	return passgo
}
示例#5
0
func NewPasswordLengthFlag() *password.Length {
	return password.NewLength()
}