Documentation ¶
Index ¶
- Variables
- func IsPathDir(path string) bool
- func PathExists(path string) bool
- func RemoveDuplicates(elements []string) []string
- type AddFileWatchFunc
- type EncryptedFileReader
- type EncryptedFileWriter
- type Space
- func (s *Space) AddItems(ctx context.Context, sourcePaths []string, targetPath string, ...) (<-chan domain.AddItemResult, domain.AddItemsResponse, 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) GenerateFileSharingLink(ctx context.Context, path string, bucketName string) (domain.FileSharingInfo, error)
- func (s *Space) GenerateKeyPair(ctx context.Context, useForce bool) (domain.KeyPair, error)
- func (s *Space) GetConfig(ctx context.Context) domain.AppConfig
- func (s *Space) GetIdentityByUsername(ctx context.Context, username string) (*domain.Identity, 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) ([]domain.FileInfo, error)
- func (s *Space) ListDirs(ctx context.Context, path string, bucketName string) ([]domain.FileInfo, error)
- func (s *Space) OpenFile(ctx context.Context, path string, bucketName string) (domain.OpenFileInfo, error)
- func (s *Space) OpenSharedFile(ctx context.Context, hash, key, filename string) (domain.OpenFileInfo, error)
- func (s *Space) RegisterSyncer(sync Syncer)
- func (s *Space) ShareBucket(ctx context.Context, slug string) (*domain.ThreadInfo, error)
- type Syncer
Constants ¶
This section is empty.
Variables ¶
var IVBlockSize = 16
Initialization vector size is 16 bytes this corresponds to the block size of the cipher key used in encrypted writer
Functions ¶
func PathExists ¶
func RemoveDuplicates ¶
Types ¶
type AddFileWatchFunc ¶
type AddFileWatchFunc = func(addFileInfo domain.AddWatchFile) error
type EncryptedFileReader ¶ added in v0.0.10
type EncryptedFileReader struct {
// contains filtered or unexported fields
}
EncryptedFileReader reads an encrypted stream and decrypts them from the decoded stream decoded bytes are then written to the writer
type EncryptedFileWriter ¶ added in v0.0.10
EncryptedFileWriter writes while encrypting the written bytes using the encryption key provided
func (*EncryptedFileWriter) EncodeKey ¶ added in v0.0.10
func (e *EncryptedFileWriter) EncodeKey() string
EncodeKey returns a base64 hash of the IV+Key used for encryption
type Space ¶
type Space struct {
// contains filtered or unexported fields
}
Implementation for space.Service
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) GenerateFileSharingLink ¶ added in v0.0.10
func (*Space) GenerateKeyPair ¶
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) 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) ([]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) ([]domain.FileInfo, error)
ListDirs lists all children entries at path in a bucket Unlike ListDir, it includes all subfolders children recursively
func (*Space) OpenSharedFile ¶ added in v0.0.10
func (s *Space) OpenSharedFile(ctx context.Context, hash, key, filename string) (domain.OpenFileInfo, error)
OpenSharedFile fetched the ipfs file and decrypts it with the key. Then returns the decrypted files location.