utils

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOrCheckMainPassword

func AddOrCheckMainPassword(db *gorm.DB) string

AddOrCheckMainPassword add a main password to the application

func AddOrCreateConfigDir

func AddOrCreateConfigDir() error

AddOrCreateConfigDir creates the .glitzy folder in the home directory

func Decrypt

func Decrypt(key, data []byte) ([]byte, error)

Decrypt is used to decrypt the cipher with the password

func DeriveKey

func DeriveKey(password, salt []byte) ([]byte, []byte, error)

DeriveKey derive a key with the password

func Encrypt

func Encrypt(key, data []byte) ([]byte, error)

Encrypt is used to encrypt the clear text password

func GetInfo

func GetInfo(db *gorm.DB) *models.User

GetInfo input the user info from terminal

func GetNormalString

func GetNormalString(promptText string) string

GetNormalString input normal text from terminal

Types

This section is empty.

Jump to

Keyboard shortcuts

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