services

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPathDir

func IsPathDir(path string) bool

func PathExists

func PathExists(path string) bool

func RemoveDuplicates

func RemoveDuplicates(elements []string) []string

Types

type AddFileWatchFunc

type AddFileWatchFunc = func(addFileInfo domain.AddWatchFile) error

type Space

type Space struct {
	// contains filtered or unexported fields
}

Implementation for space.Service

func NewSpace

func NewSpace(st store.Store, tc textile.Client, syncer Syncer, cfg config.Config, env env.SpaceEnv, kc keychain.Keychain) *Space

func (*Space) AddItems

func (s *Space) AddItems(ctx context.Context, sourcePaths []string, targetPath string, bucketName string) (<-chan domain.AddItemResult, domain.AddItemsResponse, error)

func (*Space) CreateBucket

func (s *Space) CreateBucket(ctx context.Context, slug string) (textile.Bucket, error)

func (*Space) CreateFolder

func (s *Space) CreateFolder(ctx context.Context, path string, bucketName string) error

func (*Space) CreateIdentity

func (s *Space) CreateIdentity(ctx context.Context, username string) (*domain.Identity, error)

Creates an identity in Space cloud services. Returns the created identity or an error if any.

func (*Space) GenerateKeyPair

func (s *Space) GenerateKeyPair(ctx context.Context, useForce bool) (domain.KeyPair, error)

func (*Space) GetConfig

func (s *Space) GetConfig(ctx context.Context) domain.AppConfig

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 (s *Space) JoinBucket(ctx context.Context, slug string, threadinfo *domain.ThreadInfo) (bool, error)

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) OpenFile

func (s *Space) OpenFile(ctx context.Context, path string, bucketName string) (domain.OpenFileInfo, error)

func (*Space) RegisterSyncer

func (s *Space) RegisterSyncer(sync Syncer)

func (*Space) ShareBucket added in v0.0.8

func (s *Space) ShareBucket(ctx context.Context, slug string) (*domain.ThreadInfo, error)

type Syncer

type Syncer interface {
	AddFileWatch(addFileInfo domain.AddWatchFile) error
	GetOpenFilePath(bucketSlug string, bucketPath string) (string, bool)
}

Jump to

Keyboard shortcuts

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