Documentation ¶
Index ¶
- Constants
- func CreateDataDir(dir string) error
- func GetAccountAppStorage(rootDir string, accountID string, key []byte, salt []byte) (datastore.Datastore, error)
- func GetAccountDir(rootDir, accountID string) string
- func GetAccountMetaForName(ctx context.Context, rootDir string, accountID string, storageKey []byte, ...) (*accounttypes.AccountMetadata, error)
- func GetAccountsDir(rootDir string) string
- func GetDevicePushKeyForPath(filePath string, createIfMissing bool) (pk *[cryptoutil.KeySize]byte, sk *[cryptoutil.KeySize]byte, err error)
- func GetGlobalAppStorage(rootDir string, ks NativeKeystore) (datastore.Batching, func() error, error)
- func GetGormDBForPath(dbPath string, key []byte, salt []byte, logger *zap.Logger) (*gorm.DB, func(), error)
- func GetMessengerDBForPath(dir string, key []byte, salt []byte, logger *zap.Logger) (*gorm.DB, func(), error)
- func GetOrCreateAppStorageSaltForAccount(ks NativeKeystore, accountID string) ([]byte, error)
- func GetOrCreateGlobalAppStorageSalt(ks NativeKeystore) ([]byte, error)
- func GetOrCreateGlobalSalt(ks NativeKeystore, name string) ([]byte, error)
- func GetOrCreateIPFSDatastoreSaltForAccount(ks NativeKeystore, accountID string) ([]byte, error)
- func GetOrCreateMasterStorageKey(ks NativeKeystore) ([]byte, error)
- func GetOrCreateMessengerDBSaltForAccount(ks NativeKeystore, accountID string) ([]byte, error)
- func GetOrCreateRootDatastoreSaltForAccount(ks NativeKeystore, accountID string) ([]byte, error)
- func GetOrCreateSaltForAccount(ks NativeKeystore, accountID string, name string) ([]byte, error)
- func GetOrCreateStorageKeyForAccount(ks NativeKeystore, accountID string) ([]byte, error)
- func GetReplicationDBForPath(dir string, logger *zap.Logger) (*gorm.DB, func(), error)
- func GetRootDatastoreForPath(dir string, key []byte, salt []byte, logger *zap.Logger) (datastore.Batching, error)
- func ListAccounts(ctx context.Context, rootDir string, ks NativeKeystore, logger *zap.Logger) ([]*accounttypes.AccountMetadata, error)
- type MemNativeKeystore
- type NativeKeystore
Constants ¶
View Source
const ( InMemoryDir = ":memory:" DefaultPushKeyFilename = "push.key" AccountMetafileName = "account_meta" AccountNetConfFileName = "account_net_conf" MessengerDatabaseFilename = "messenger.sqlite" ReplicationDatabaseFilename = "replication.sqlite" StorageKeyName = "storage" StorageKeySize = 32 StorageSaltSize = 16 )
Variables ¶
This section is empty.
Functions ¶
func CreateDataDir ¶ added in v2.431.0
func GetAccountAppStorage ¶ added in v2.331.0
func GetAccountDir ¶ added in v2.315.0
func GetAccountMetaForName ¶
func GetAccountsDir ¶ added in v2.315.0
func GetDevicePushKeyForPath ¶
func GetDevicePushKeyForPath(filePath string, createIfMissing bool) (pk *[cryptoutil.KeySize]byte, sk *[cryptoutil.KeySize]byte, err error)
func GetGlobalAppStorage ¶ added in v2.431.0
func GetGlobalAppStorage(rootDir string, ks NativeKeystore) (datastore.Batching, func() error, error)
func GetGormDBForPath ¶ added in v2.311.2
func GetMessengerDBForPath ¶
func GetOrCreateAppStorageSaltForAccount ¶ added in v2.431.0
func GetOrCreateAppStorageSaltForAccount(ks NativeKeystore, accountID string) ([]byte, error)
func GetOrCreateGlobalAppStorageSalt ¶ added in v2.431.0
func GetOrCreateGlobalAppStorageSalt(ks NativeKeystore) ([]byte, error)
func GetOrCreateGlobalSalt ¶ added in v2.431.0
func GetOrCreateGlobalSalt(ks NativeKeystore, name string) ([]byte, error)
func GetOrCreateIPFSDatastoreSaltForAccount ¶ added in v2.431.0
func GetOrCreateIPFSDatastoreSaltForAccount(ks NativeKeystore, accountID string) ([]byte, error)
func GetOrCreateMasterStorageKey ¶ added in v2.331.0
func GetOrCreateMasterStorageKey(ks NativeKeystore) ([]byte, error)
func GetOrCreateMessengerDBSaltForAccount ¶ added in v2.431.0
func GetOrCreateMessengerDBSaltForAccount(ks NativeKeystore, accountID string) ([]byte, error)
func GetOrCreateRootDatastoreSaltForAccount ¶ added in v2.431.0
func GetOrCreateRootDatastoreSaltForAccount(ks NativeKeystore, accountID string) ([]byte, error)
func GetOrCreateSaltForAccount ¶ added in v2.431.0
func GetOrCreateSaltForAccount(ks NativeKeystore, accountID string, name string) ([]byte, error)
func GetOrCreateStorageKeyForAccount ¶ added in v2.331.0
func GetOrCreateStorageKeyForAccount(ks NativeKeystore, accountID string) ([]byte, error)
func GetReplicationDBForPath ¶ added in v2.311.2
func GetRootDatastoreForPath ¶
func ListAccounts ¶
func ListAccounts(ctx context.Context, rootDir string, ks NativeKeystore, logger *zap.Logger) ([]*accounttypes.AccountMetadata, error)
Types ¶
type MemNativeKeystore ¶ added in v2.431.0
type MemNativeKeystore struct {
// contains filtered or unexported fields
}
type NativeKeystore ¶ added in v2.319.0
type NativeKeystore interface { Put(key string, data []byte) error Get(key string) ([]byte, error) }
func NewMemNativeKeystore ¶ added in v2.431.0
func NewMemNativeKeystore() NativeKeystore
Click to show internal directories.
Click to hide internal directories.