space

package
v0.0.25-dev Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service interface {
	RegisterSyncer(sync services.Syncer)
	OpenFile(ctx context.Context, path, bucketName, dbID string) (domain.OpenFileInfo, error)
	GetConfig(ctx context.Context) domain.AppConfig
	ListDirs(ctx context.Context, path string, bucketName string, listMembers bool) ([]domain.FileInfo, error)
	ListDir(ctx context.Context, path string, bucketName string, listMembers bool) ([]domain.FileInfo, error)
	GenerateKeyPair(ctx context.Context, useForce bool) (mnemonic string, err error)
	DeleteKeypair(ctx context.Context) error
	GetMnemonic(ctx context.Context) (mnemonic string, err error)
	RestoreKeyPairFromMnemonic(ctx context.Context, mnemonic string) error
	RecoverKeysByPassphrase(ctx context.Context, uuid string, pass string) error
	BackupKeysByPassphrase(ctx context.Context, uuid string, pass string) error
	TestPassphrase(ctx context.Context, uuid string, pass string) error
	GetPublicKey(ctx context.Context) (string, error)
	GetHubAuthToken(ctx context.Context) (string, error)
	CreateFolder(ctx context.Context, path string, bucketName string) error
	CreateBucket(ctx context.Context, slug string) (textile.Bucket, error)
	ListBuckets(ctx context.Context) ([]textile.Bucket, error)
	AddItems(ctx context.Context, sourcePaths []string, targetPath string, bucketName string) (<-chan domain.AddItemResult, domain.AddItemsResponse, error)
	AddItemWithReader(ctx context.Context, reader io.Reader, targetPath, bucketName string) (domain.AddItemResult, error)
	CreateIdentity(ctx context.Context, username string) (*domain.Identity, error)
	GetIdentityByUsername(ctx context.Context, username string) (*domain.Identity, error)
	GenerateFileSharingLink(ctx context.Context, encryptionPassword, path, bucketName, dbID string) (domain.FileSharingInfo, error)
	GenerateFilesSharingLink(ctx context.Context, encryptionPassword string, paths []string, bucketName, dbID string) (domain.FileSharingInfo, error)
	OpenSharedFile(ctx context.Context, cid, password, filename string) (domain.OpenFileInfo, error)
	ShareBucket(ctx context.Context, slug string) (*domain.ThreadInfo, error)
	JoinBucket(ctx context.Context, slug string, threadinfo *domain.ThreadInfo) (bool, error)
	CreateLocalKeysBackup(ctx context.Context, pathToKeyBackup string) error
	RecoverKeysByLocalBackup(ctx context.Context, pathToKeyBackup string) error
	GetNotifications(ctx context.Context, seek string, limit int) ([]*domain.Notification, error)
	ToggleBucketBackup(ctx context.Context, bucketName string, bucketBackup bool) error
	ShareFilesViaPublicKey(ctx context.Context, paths []domain.FullPath, pubkeys []crypto.PubKey) error
	HandleSharedFilesInvitation(ctx context.Context, invitationId string, accept bool) error
	GetAPISessionTokens(ctx context.Context) (*domain.APISessionTokens, error)
	AddRecentlySharedPublicKeys(ctx context.Context, pubkeys []crypto.PubKey) error
	RecentlySharedPublicKeys(ctx context.Context) ([]crypto.PubKey, error)
	GetSharedWithMeFiles(ctx context.Context, seek string, limit int) ([]*domain.SharedDirEntry, string, error)
	SetNotificationsLastSeenAt(timestamp int64) error
	GetNotificationsLastSeenAt() (int64, error)
}

Service Layer should not depend on gRPC dependencies

func NewService

func NewService(
	store store.Store,
	tc textile.Client,
	sync services.Syncer,
	cfg config.Config,
	kc keychain.Keychain,
	v vault.Vault,
	h hub.HubAuth,
	opts ...ServiceOption,
) (Service, error)

type ServiceOption

type ServiceOption func(o *serviceOptions)

func WithEnv

func WithEnv(env env.SpaceEnv) ServiceOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL