Documentation
¶
Index ¶
- Variables
- func IsPathDir(path string) bool
- func PathExists(path string) bool
- func RemoveDuplicates(elements []string) []string
- type AddFileWatchFunc
- type CountingReader
- type Space
- func (s *Space) AddItemWithReader(ctx context.Context, reader io.Reader, targetPath, bucketName string) (domain.AddItemResult, error)
- func (s *Space) AddItems(ctx context.Context, sourcePaths []string, targetPath string, ...) (<-chan domain.AddItemResult, domain.AddItemsResponse, error)
- func (s *Space) AddRecentlySharedPublicKeys(ctx context.Context, pubkeys []crypto.PubKey) error
- func (s *Space) BackupKeysByPassphrase(ctx context.Context, uuid string, pass string, backupType domain.KeyBackupType) error
- func (s *Space) BucketBackupRestore(ctx context.Context, bucketSlug string) error
- func (s *Space) CreateBucket(ctx context.Context, slug string) (textile.Bucket, error)
- func (s *Space) CreateFolder(ctx context.Context, path string, bucketName string) error
- func (s *Space) CreateIdentity(ctx context.Context, username string) (*domain.Identity, error)
- func (s *Space) CreateLocalKeysBackup(ctx context.Context, path string) error
- func (s *Space) DeleteKeypair(ctx context.Context) error
- func (s *Space) GenerateFileSharingLink(ctx context.Context, encryptionPassword string, path string, bucketName string, ...) (domain.FileSharingInfo, error)
- func (s *Space) GenerateFilesSharingLink(ctx context.Context, encryptionPassword string, paths []string, ...) (domain.FileSharingInfo, error)
- func (s *Space) GenerateKeyPair(ctx context.Context, useForce bool) (string, error)
- func (s *Space) GetAPISessionTokens(ctx context.Context) (*domain.APISessionTokens, error)
- func (s *Space) GetConfig(ctx context.Context) domain.AppConfig
- func (s *Space) GetHubAuthToken(ctx context.Context) (string, error)
- func (s *Space) GetIdentityByUsername(ctx context.Context, username string) (*domain.Identity, error)
- func (s *Space) GetMnemonic(ctx context.Context) (string, error)
- func (s *Space) GetNotifications(ctx context.Context, seek string, limit int) ([]*domain.Notification, error)
- func (s *Space) GetNotificationsLastSeenAt() (int64, error)
- func (s *Space) GetPublicKey(ctx context.Context) (string, error)
- func (s *Space) GetSharedByMeFiles(ctx context.Context, seek string, limit int) ([]*domain.SharedDirEntry, string, error)
- func (s *Space) GetSharedWithMeFiles(ctx context.Context, seek string, limit int) ([]*domain.SharedDirEntry, string, error)
- func (s *Space) HandleSharedFilesInvitation(ctx context.Context, invitationId string, accept bool) error
- func (s *Space) InitializeMasterAppToken(ctx context.Context) (*permissions.AppToken, error)
- func (s *Space) JoinBucket(ctx context.Context, slug string, threadinfo *domain.ThreadInfo) (bool, error)
- func (s *Space) ListBuckets(ctx context.Context) ([]textile.Bucket, error)
- func (s *Space) ListDir(ctx context.Context, path string, bucketName string, listMembers bool) ([]domain.FileInfo, error)
- func (s *Space) ListDirs(ctx context.Context, path string, bucketName string, listMembers bool) ([]domain.FileInfo, error)
- func (s *Space) OpenFile(ctx context.Context, path, bucketName, dbID string) (domain.OpenFileInfo, error)
- func (s *Space) OpenSharedFile(ctx context.Context, hash, password, filename string) (domain.OpenFileInfo, error)
- func (s *Space) RecentlySharedPublicKeys(ctx context.Context) ([]crypto.PubKey, error)
- func (s *Space) RecoverKeysByLocalBackup(ctx context.Context, path string) error
- func (s *Space) RecoverKeysByPassphrase(ctx context.Context, uuid string, pass string, backupType domain.KeyBackupType) error
- func (s *Space) RegisterSyncer(sync Syncer)
- func (s *Space) RemoveDirOrFile(ctx context.Context, path, bucketName string) error
- func (s *Space) RestoreKeyPairFromMnemonic(ctx context.Context, mnemonic string) error
- func (s *Space) SearchFiles(ctx context.Context, query string) ([]domain.SearchFileEntry, error)
- func (s *Space) SetNotificationsLastSeenAt(timestamp int64) error
- func (s *Space) ShareBucket(ctx context.Context, slug string) (*domain.ThreadInfo, error)
- func (s *Space) ShareFilesViaPublicKey(ctx context.Context, paths []domain.FullPath, pubkeys []crypto.PubKey) error
- func (s *Space) TestPassphrase(ctx context.Context, uuid string, pass string) error
- func (s *Space) ToggleBucketBackup(ctx context.Context, bucketSlug string, bucketBackup bool) error
- func (s *Space) TruncateData(ctx context.Context) error
- func (s *Space) UnshareFilesViaPublicKey(ctx context.Context, paths []domain.FullPath, pubkeys []crypto.PubKey) error
- type Syncer
Constants ¶
This section is empty.
Variables ¶
var EmptyFileSharingInfo = domain.FileSharingInfo{}
Functions ¶
func PathExists ¶
func RemoveDuplicates ¶
Types ¶
type AddFileWatchFunc ¶
type AddFileWatchFunc = func(addFileInfo domain.AddWatchFile) error
type CountingReader ¶ added in v0.0.19
type CountingReader struct { BytesRead int64 // contains filtered or unexported fields }
Reader that also counts the amount of Bytes read from the wrappeed reader
func NewCountingReader ¶ added in v0.0.19
func NewCountingReader(reader io.Reader) *CountingReader
type Space ¶
type Space struct {
// contains filtered or unexported fields
}
Implementation for space.Service
func (*Space) AddItemWithReader ¶ added in v0.0.19
func (s *Space) AddItemWithReader( ctx context.Context, reader io.Reader, targetPath, bucketName string, ) (domain.AddItemResult, error)
AddItemWithReader uploads content of the reader to the targetPath on the bucket specified
Note: the AddItemResult returns an empty SourcePath
func (*Space) AddRecentlySharedPublicKeys ¶ added in v0.0.13
func (*Space) BackupKeysByPassphrase ¶ added in v0.0.13
func (s *Space) BackupKeysByPassphrase(ctx context.Context, uuid string, pass string, backupType domain.KeyBackupType) error
Uses the vault service to securely store the current keypair
func (*Space) BucketBackupRestore ¶ added in v0.0.28
func (*Space) CreateBucket ¶
Creates a bucket
func (*Space) CreateFolder ¶
func (*Space) CreateIdentity ¶
Creates an identity in Space cloud services. Returns the created identity or an error if any.
func (*Space) CreateLocalKeysBackup ¶ added in v0.0.13
Creates an obfuscated local file that contains everything needed to restore the state from this or another device
func (*Space) DeleteKeypair ¶ added in v0.0.13
func (*Space) GenerateFileSharingLink ¶ added in v0.0.10
func (*Space) GenerateFilesSharingLink ¶ added in v0.0.13
func (s *Space) GenerateFilesSharingLink( ctx context.Context, encryptionPassword string, paths []string, bucketName, dbID string, ) (domain.FileSharingInfo, error)
GenerateFilesSharingLink zips multiple files together
func (*Space) GenerateKeyPair ¶
Generates a key pair and returns a mnemonic for recovering that key later on
func (*Space) GetAPISessionTokens ¶ added in v0.0.13
Return session token for central services authenticated access
func (*Space) GetHubAuthToken ¶ added in v0.0.12
func (*Space) GetIdentityByUsername ¶
func (s *Space) GetIdentityByUsername(ctx context.Context, username string) (*domain.Identity, error)
Gets an identity from Space cloud services given a username
func (*Space) GetMnemonic ¶ added in v0.0.13
func (*Space) GetNotifications ¶ added in v0.0.13
func (*Space) GetNotificationsLastSeenAt ¶ added in v0.0.14
func (*Space) GetPublicKey ¶ added in v0.0.11
func (*Space) GetSharedByMeFiles ¶ added in v0.0.34
func (s *Space) GetSharedByMeFiles(ctx context.Context, seek string, limit int) ([]*domain.SharedDirEntry, string, error)
Returns a list of shared files the user has shared
func (*Space) GetSharedWithMeFiles ¶ added in v0.0.14
func (s *Space) GetSharedWithMeFiles(ctx context.Context, seek string, limit int) ([]*domain.SharedDirEntry, string, error)
Returns a list of shared files the user has received and accepted
func (*Space) HandleSharedFilesInvitation ¶ added in v0.0.13
func (s *Space) HandleSharedFilesInvitation(ctx context.Context, invitationId string, accept bool) error
HandleSharedFilesInvitation accepts or rejects an invitation based on the invitation id
func (*Space) InitializeMasterAppToken ¶ added in v0.1.0
func (*Space) JoinBucket ¶ added in v0.0.8
func (*Space) ListBuckets ¶ added in v0.0.10
Returns a list of buckets the current user has access to
func (*Space) ListDir ¶
func (s *Space) ListDir(ctx context.Context, path string, bucketName string, listMembers bool) ([]domain.FileInfo, error)
ListDir returns children entries at path in a bucket
func (*Space) ListDirs ¶
func (s *Space) ListDirs(ctx context.Context, path string, bucketName string, listMembers bool) ([]domain.FileInfo, error)
ListDirs lists all children entries at path in a bucket Unlike ListDir, it includes all subfolders children recursively
func (*Space) OpenFile ¶
func (s *Space) OpenFile(ctx context.Context, path, bucketName, dbID string) (domain.OpenFileInfo, error)
Copies a file inside a bucket into a temp, unencrypted version of the file in the local file system Include dbID if opening a shared file. Use dbID = "" otherwise.
func (*Space) OpenSharedFile ¶ added in v0.0.10
func (s *Space) OpenSharedFile(ctx context.Context, hash, password, filename string) (domain.OpenFileInfo, error)
OpenSharedFile fetched the ipfs file and decrypts it with the key. Then returns the decrypted files location. NOTE: This only opens public link shared files and not those shared via direct invites.
func (*Space) RecentlySharedPublicKeys ¶ added in v0.0.13
func (*Space) RecoverKeysByLocalBackup ¶ added in v0.0.13
Restores the state by receiving the path to a local backup Warning: This will delete any local state before restoring the backup
func (*Space) RecoverKeysByPassphrase ¶ added in v0.0.13
func (s *Space) RecoverKeysByPassphrase(ctx context.Context, uuid string, pass string, backupType domain.KeyBackupType) error
Uses vault service to fetch and decrypt a keypair set
func (*Space) RegisterSyncer ¶
func (*Space) RemoveDirOrFile ¶ added in v0.1.3
Removes a file or directory from a bucket Note: If removing a file a user has been shared, call the RemoveMember method instead, as this works only for local buckets.
func (*Space) RestoreKeyPairFromMnemonic ¶ added in v0.0.13
func (*Space) SearchFiles ¶ added in v0.0.30
func (*Space) SetNotificationsLastSeenAt ¶ added in v0.0.14
func (*Space) ShareBucket ¶ added in v0.0.8
func (*Space) ShareFilesViaPublicKey ¶ added in v0.0.13
func (*Space) TestPassphrase ¶ added in v0.0.13
Tests a passphrase without storing anything to check if the passphrase is correct
func (*Space) ToggleBucketBackup ¶ added in v0.0.13
func (*Space) TruncateData ¶ added in v0.0.30
TruncateData removes all data from local machine