Documentation
¶
Index ¶
- Constants
- type Storage
- func (s *Storage) BucketExists(name []byte) bool
- func (s *Storage) Close() error
- func (s *Storage) Decrypt(ciphertext []byte) ([]byte, error)
- func (s *Storage) DeleteAll() error
- func (s *Storage) Encrypt(plaintext []byte) ([]byte, error)
- func (s *Storage) Load(bucketName string, key string, dest any) (found bool, err error)
- func (s *Storage) LoadPreferences(defaultPreferences clientsettings.Preferences) (clientsettings.Preferences, error)
- func (s *Storage) Open() error
- func (s *Storage) StorePreferences(prefs clientsettings.Preferences) error
- func (s *Storage) Transaction(f func(*Transaction) error) error
- func (s *Storage) TxDelete(tx *Transaction, bucketName string, key string) error
- func (s *Storage) TxDeleteAll(tx *Transaction) error
- func (s *Storage) TxDeleteUserdata(tx *Transaction) error
- func (s *Storage) TxLoad(tx *Transaction, bucketName string, key string, dest any) (found bool, err error)
- func (s *Storage) TxStore(tx *Transaction, bucketName string, key string, value any) error
- func (s *Storage) TxStorePreferences(tx *Transaction, prefs clientsettings.Preferences) error
- type Transaction
Constants ¶
View Source
const ( UserdataBucket = "userdata" // Key/value: specified below PreferencesKey = "preferences" // Value: Preferences )
Bucketnames bbolt Note: crypto specific buckets should not clash with eachother!
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
Storage provider for a Client
func NewStorage ¶
func NewStorage(storagePath string, encryptionMiddleware encryption.EncryptionMiddleware) *Storage
func (*Storage) BucketExists ¶
func (*Storage) LoadPreferences ¶
func (s *Storage) LoadPreferences(defaultPreferences clientsettings.Preferences) (clientsettings.Preferences, error)
func (*Storage) Open ¶
Open initializes the credential storage, ensuring that it is in a usable state. Setting it up in a properly protected location (e.g., with automatic backups to iCloud/Google disabled) is the responsibility of the user.
func (*Storage) StorePreferences ¶
func (s *Storage) StorePreferences(prefs clientsettings.Preferences) error
func (*Storage) Transaction ¶
func (s *Storage) Transaction(f func(*Transaction) error) error
func (*Storage) TxDelete ¶
func (s *Storage) TxDelete(tx *Transaction, bucketName string, key string) error
func (*Storage) TxDeleteAll ¶
func (s *Storage) TxDeleteAll(tx *Transaction) error
func (*Storage) TxDeleteUserdata ¶
func (s *Storage) TxDeleteUserdata(tx *Transaction) error
func (*Storage) TxStorePreferences ¶
func (s *Storage) TxStorePreferences(tx *Transaction, prefs clientsettings.Preferences) error
type Transaction ¶
Click to show internal directories.
Click to hide internal directories.