go-mmkv/interface.go

17 lines
443 B
Go
Raw Normal View History

2022-12-04 22:27:41 +00:00
package mmkv
type Manager interface {
// OpenVault opens a vault with the given id.
// If the vault does not exist, it will be created.
// If id is empty, DefaultVaultID will be used.
OpenVault(id string) (Vault, error)
2024-02-04 16:47:24 +00:00
OpenVaultCrypto(id string, cryptoKey string) (Vault, error)
2022-12-04 22:27:41 +00:00
}
type Vault interface {
Keys() []string
2022-12-04 23:14:32 +00:00
GetRaw(key string) ([]byte, bool)
GetBytes(key string) ([]byte, error)
GetString(key string) (string, error)
2022-12-04 22:27:41 +00:00
}