Documentation ¶
Overview ¶
Package gpm ...
Copyright © 2020 Injamul Mohammad Mollah ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func ConfirmPrompt(message string) bool
- func Copy(src, dst string) error
- func CreateDatabase() error
- func Decrypt(key, data []byte) ([]byte, error)
- func Encrypt(key, data []byte) ([]byte, error)
- func GeneratePassword(length int) string
- func GetFileName(filename, extension string) string
- func GetHomeDir() string
- func GetLicense() string
- func GetVersion() string
- func LineBreak() string
- func PagerErrorLogger(err error)
- func RemoveDuplicate(slice []int) []int
- func SavePasswords(key []byte, accounts []Account) error
- func SortSlice(slice []int) []int
- func ToPager(data string) error
- func VerifyKey(key, data []byte) bool
- type Account
- type CSVPassword
Constants ¶
This section is empty.
Variables ¶
var DatabaseFile string = GetHomeDir() + "/.config/gpassmanager/gpassmanager.bin"
DatabaseFile is the db file
Functions ¶
func ConfirmPrompt ¶ added in v0.4.0
ConfirmPrompt will prompt to user for yes or no
func CreateDatabase ¶
func CreateDatabase() error
CreateDatabase create folder and the file to save data
func GeneratePassword ¶ added in v0.4.0
GeneratePassword will return Password
func GetFileName ¶ added in v0.5.0
GetFileName simplify filenames for use (Note: only 3 char ext)
func PagerErrorLogger ¶ added in v1.0.0
func PagerErrorLogger(err error)
PagerErrorLogger logs error to stdout
func RemoveDuplicate ¶ added in v0.4.1
RemoveDuplicate removes duplicate from slice
func SavePasswords ¶
SavePasswords save all password
Types ¶
type Account ¶
type Account struct { AccountName string `json:"account_name"` UserName string `json:"username"` Email string `json:"email"` Phone string `json:"phone"` Password string `json:"password"` Notes string `json:"notes"` }
Account contains all details for a account
func ConvertToAccount ¶ added in v0.5.0
func ConvertToAccount(csvpasswords []CSVPassword) []Account
ConvertToAccount converts CSVPassword into Account
func ReadPasswords ¶
ReadPasswords decrypt all password
func RemoveAccount ¶ added in v0.2.0
RemoveAccount removes an acccount
type CSVPassword ¶ added in v0.5.0
type CSVPassword struct { Name string `csv:"name"` URL string `csv:"url"` Username string `csv:"username"` Password string `csv:"password"` }
CSVPassword contains csv parsed passwords
func ReadCSV ¶ added in v0.5.0
func ReadCSV(filename string) ([]CSVPassword, error)
ReadCSV returns parsed Passwords (*Google Password csv file)