Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DecryptCmd = &cobra.Command{ Use: "decrypt", Short: "Decrypt File or Directory", Args: enc_dec_ArgsValidator, Run: func(cmd *cobra.Command, args []string) { pwds, err := util.ScanEncPwd(false) if err != nil { return } _, decPwds, err := crypto.Chaos(pwds) if err != nil { logger.Error(err) return } if file != "" { if err := decrypt(file, decPwds); err != nil { return } } if dir != "" { err := filepath.Walk(dir, func(file string, info os.FileInfo, err error) error { if info.IsDir() { return nil } return decrypt(file, decPwds) }) if err != nil { return } } fmt.Println("decrypt success") }, }
View Source
var EncryptCmd = &cobra.Command{ Use: "encrypt", Short: "Encrypt File or Directory", Args: enc_dec_ArgsValidator, Run: func(cmd *cobra.Command, args []string) { pwds, err := util.ScanEncPwd(true) if err != nil { return } _, encPwds, err := crypto.Chaos(pwds) if err != nil { logger.Error(err) return } if file != "" { if err := encrypt(file, encPwds); err != nil { return } } if dir != "" { err := filepath.Walk(dir, func(file string, info os.FileInfo, err error) error { if info.IsDir() { return nil } return encrypt(file, encPwds) }) if err != nil { return } } fmt.Println("encrypt success") }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.