store

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddItem

func AddItem(c *cli.Context) error

func Backup added in v0.0.11

func Backup(c *cli.Context) error

func ChangeToSimpleItem

func ChangeToSimpleItem(answers *model.DetailItem, key []byte) *model.SimpleItem

func ConvToItems

func ConvToItems(items []*model.SimpleItem) []*model.DetailItem

func CountItems

func CountItems(db *sql.DB, keyword string) (int, error)

func CreateTable

func CreateTable(db *sql.DB) error

func DelItem

func DelItem(c *cli.Context) error

func DeleteItem

func DeleteItem(db *sql.DB, itemId int) error

func GetHint

func GetHint(db *sql.DB) (string, error)

func GetItem

func GetItem(db *sql.DB, itemId int) (*model.SimpleItem, error)

func InsertHint

func InsertHint(db *sql.DB, hint string) error

func InsertItem

func InsertItem(db *sql.DB, item *model.SimpleItem) error

func ModifyDBPassword added in v0.0.14

func ModifyDBPassword(c *cli.Context) error

func ModifyItem

func ModifyItem(c *cli.Context) error

func OtpItem added in v0.0.16

func OtpItem(c *cli.Context) error

func ParseSimpleItem

func ParseSimpleItem(item *model.SimpleItem, key []byte) *model.DetailItem

func PasswordComplexityRequired added in v0.0.14

func PasswordComplexityRequired(val interface{}) error

func PrintBackups added in v0.0.11

func PrintBackups(items []model.BackupItem)

func PrintItems

func PrintItems(items []*model.DetailItem)

func Query

func Query(db *sql.DB, keyword string, pageId, pageSize int) ([]*model.SimpleItem, error)

func Quit

func Quit(c *cli.Context) error

func RestoreItem added in v0.0.11

func RestoreItem(c *cli.Context) error

func SearchItem

func SearchItem(c *cli.Context) error

func UpdateItem

func UpdateItem(db *sql.DB, item *model.SimpleItem) error

func ViewItem

func ViewItem(c *cli.Context) error

Types

type DatabaseStore

type DatabaseStore struct {
	DatabaseName string
	Hint         string
	Items        []*model.SimpleItem
	FileName     string
	FullPath     string
	Key          []byte
	DataBaseIV   string
	DB           *sql.DB
	TempFile     string
	Dirty        bool
	NeedBackup   bool
	BackupItems  []model.BackupItem
}
var (
	GlobalStore *DatabaseStore
)

func NewDatabaseStore

func NewDatabaseStore(dataPath string, database *model.Database) *DatabaseStore

func OpenDatabaseStore

func OpenDatabaseStore(dataPath string, database *model.Database) (*DatabaseStore, error)

func (*DatabaseStore) Close

func (s *DatabaseStore) Close() error

func (*DatabaseStore) Init

func (s *DatabaseStore) Init() error

Jump to

Keyboard shortcuts

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