Documentation ¶
Index ¶
- func Decrypt(key string, text []byte) ([]byte, error)
- func Encrypt(key string, text []byte) ([]byte, error)
- type Passwd
- type SqliteStore
- func (s *SqliteStore) Delete(ctx context.Context, name string) error
- func (s *SqliteStore) Get(ctx context.Context, name string) (*Passwd, error)
- func (s *SqliteStore) Save(ctx context.Context, passwd *Passwd) error
- func (s *SqliteStore) SearchName(ctx context.Context, name string) ([]string, error)
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SqliteStore ¶
type SqliteStore struct {
// contains filtered or unexported fields
}
func NewSqliteStore ¶
func NewSqliteStore(ctx context.Context) *SqliteStore
func (*SqliteStore) Delete ¶
func (s *SqliteStore) Delete(ctx context.Context, name string) error
Delete 删除一个记录
func (*SqliteStore) Save ¶
func (s *SqliteStore) Save(ctx context.Context, passwd *Passwd) error
Save 在使用cryptFunc对密码密文进行存储
func (*SqliteStore) SearchName ¶
SearchName 根据名称进行搜索并给出名称列表
type Store ¶
type Store interface { // Save 在使用cryptFunc对密码密文进行存储 Save(ctx context.Context, passwd *Passwd) error // Get 获取密码 Get(ctx context.Context, name string) (*Passwd, error) // SearchName 根据名称进行搜索并给出名称列表 SearchName(ctx context.Context, name string) ([]string, error) // Delete 删除一个记录 Delete(ctx context.Context, name string) error }
Click to show internal directories.
Click to hide internal directories.