dfs

package
v0.8.2-rc7 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: Apache-2.0 Imports: 15 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUserNotLoggedIn indicate the user is not logged-in
	ErrUserNotLoggedIn = errors.New("user not logged in")
	// ErrPodNotOpen indicates pod is not open
	ErrPodNotOpen = errors.New("pod not open")
	// ErrFileNotPresent indicates file is not present
	ErrFileNotPresent = errors.New("file not present")

	ErrBeeClient = errors.New("could not connect to bee client")
)

Functions

This section is empty.

Types

type API added in v0.9.1

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

API is the go api for fairOS

func NewDfsAPI

func NewDfsAPI(dataDir, apiUrl, postageBlockId string, isGatewayProxy bool, ensConfig *contracts.Config, logger logging.Logger) (*API, error)

NewDfsAPI is the main entry point for the df controller.

func NewMockDfsAPI added in v0.9.1

func NewMockDfsAPI(client blockstore.Client, users *user.Users, logger logging.Logger, dataDir string) *API

NewMockDfsAPI is used for tests only

func (*API) ClosePod added in v0.9.1

func (d *API) ClosePod(podName, sessionId string) error

func (*API) CreatePod added in v0.9.1

func (d *API) CreatePod(podName, passPhrase, sessionId string) (*pod.Info, error)

func (*API) CreateUser

func (d *API) CreateUser(userName, passPhrase, mnemonic, sessionId string) (string, string, *user.Info, error)

CreateUser is a controller function which calls the create user function from the user object. FOR MIGRATION PURPOSE ONLY

func (*API) CreateUserV2 added in v0.9.1

func (d *API) CreateUserV2(userName, passPhrase, mnemonic, sessionId string) (string, string, string, string, *user.Info, error)

CreateUserV2 is a controller function which calls the create user function from the user object.

func (*API) DeleteFile added in v0.9.1

func (d *API) DeleteFile(podName, podFileWithPath, sessionId string) error

DeleteFile is a controller function which validates if the user is logged in, pod is open and delete the file. It also remove the file entry from the parent directory.

func (*API) DeletePod added in v0.9.1

func (d *API) DeletePod(podName, passphrase, sessionId string) error

DeletePod deletes a pod

func (*API) DeleteUser

func (d *API) DeleteUser(passPhrase, sessionId string) error

DeleteUser is a controller function which deletes a logged in user.

func (*API) DeleteUserV2 added in v0.9.1

func (d *API) DeleteUserV2(passPhrase, sessionId string) error

DeleteUserV2 is a controller function which deletes a logged in user.

func (*API) DirectoryStat added in v0.9.1

func (d *API) DirectoryStat(podName, directoryName, sessionId string) (*dir.Stats, error)

DirectoryStat is a controller function which validates if the user is logged in, pod is open and calls the dir object to get the information about the given directory.

func (*API) DocBatch added in v0.9.1

func (d *API) DocBatch(sessionId, podName, name string) (*collection.DocBatch, error)

DocBatch initiates a batch inserting session.

func (*API) DocBatchPut added in v0.9.1

func (d *API) DocBatchPut(sessionId, podName string, doc []byte, docBatch *collection.DocBatch) error

DocBatchPut inserts records in to a document batch.

func (*API) DocBatchWrite added in v0.9.1

func (d *API) DocBatchWrite(sessionId, podName string, docBatch *collection.DocBatch) error

DocBatchWrite commits the batch document insert.

func (*API) DocCount added in v0.9.1

func (d *API) DocCount(sessionId, podName, name, expr string) (*collection.TableKeyCount, error)

DocCount is a controller function which does all the checks before counting all the documents ina documentDB.

func (*API) DocCreate added in v0.9.1

func (d *API) DocCreate(sessionId, podName, name string, indexes map[string]collection.IndexType, mutable bool) error

DocCreate is a controller function which does all the checks before creating a documentDB.

func (*API) DocDel added in v0.9.1

func (d *API) DocDel(sessionId, podName, name, id string) error

DocDel is a controller function which does all the checks before deleting a documentDB.

func (*API) DocDelete added in v0.9.1

func (d *API) DocDelete(sessionId, podName, name string) error

DocDelete is a controller function which does all the checks before deleting a documentDB.

func (*API) DocFind added in v0.9.1

func (d *API) DocFind(sessionId, podName, name, expr string, limit int) ([][]byte, error)

DocFind is a controller function which does all the checks before finding records from a documentDB.

func (*API) DocGet added in v0.9.1

func (d *API) DocGet(sessionId, podName, name, id string) ([]byte, error)

DocGet is a controller function which does all the checks before retrieving // a document in the documentDB.

func (*API) DocIndexJson added in v0.9.1

func (d *API) DocIndexJson(sessionId, podName, name, podFileWithPath string) error

DocIndexJson indexes a json files in to the document DB.

func (*API) DocList added in v0.9.1

func (d *API) DocList(sessionId, podName string) (map[string]collection.DBSchema, error)

DocList is a controller function which does all the checks before listing all the documentDB available in the pod.

func (*API) DocOpen added in v0.9.1

func (d *API) DocOpen(sessionId, podName, name string) error

DocOpen is a controller function which does all the checks before opening a documentDB.

func (*API) DocPut added in v0.9.1

func (d *API) DocPut(sessionId, podName, name string, value []byte) error

DocPut is a controller function which does all the checks before inserting a document in the documentDB.

func (*API) DownloadFile added in v0.9.1

func (d *API) DownloadFile(podName, podFileWithPath, sessionId string) (io.ReadCloser, uint64, error)

DownloadFile is a controller function which validates if the user is logged in, pod is open and calls the download function.

func (*API) ExportUser

func (d *API) ExportUser(sessionId string) (string, string, error)

ExportUser exports the currently logged in user.

func (*API) FileStat added in v0.9.1

func (d *API) FileStat(podName, podFileWithPath, sessionId string) (*f.Stats, error)

FileStat is a controller function which validates if the user is logged in, pod is open and gets the information about the file.

func (*API) GetUserStat added in v0.9.1

func (d *API) GetUserStat(sessionId string) (*user.Stat, error)

GetUserStat gets the information related to the user.

func (*API) IsDirPresent added in v0.9.1

func (d *API) IsDirPresent(podName, directoryNameWithPath, sessionId string) (bool, error)

IsDirPresent is acontroller function which validates if the user is logged in, pod is open and calls the dir object to check if the directory is present.

func (*API) IsPodExist added in v0.9.1

func (d *API) IsPodExist(podName, sessionId string) bool

func (*API) IsUserLoggedIn added in v0.9.1

func (d *API) IsUserLoggedIn(userName string) bool

IsUserLoggedIn checks if the given user is logged in

func (*API) IsUserNameAvailable

func (d *API) IsUserNameAvailable(userName string) bool

IsUserNameAvailable checks if a given user name is available in this dfs server.

func (*API) IsUserNameAvailableV2 added in v0.9.1

func (d *API) IsUserNameAvailableV2(userName string) bool

IsUserNameAvailableV2 checks if a given user name is available in this dfs server.

func (*API) KVBatch added in v0.9.1

func (d *API) KVBatch(sessionId, podName, name string, columns []string) (*collection.Batch, error)

KVBatch does validation checks and calls the batch KVtable function.

func (*API) KVBatchPut added in v0.9.1

func (d *API) KVBatchPut(sessionId, podName, key string, value []byte, batch *collection.Batch) error

KVBatchPut does validation checks and calls the batch put KVtable function.

func (*API) KVBatchWrite added in v0.9.1

func (d *API) KVBatchWrite(sessionId, podName string, batch *collection.Batch) error

KVBatchWrite does validation checks and calls the batch write KVtable function.

func (*API) KVCount added in v0.9.1

func (d *API) KVCount(sessionId, podName, name string) (*collection.TableKeyCount, error)

KVCount does validation checks and calls the count KVtable function.

func (*API) KVCreate added in v0.9.1

func (d *API) KVCreate(sessionId, podName, name string, indexType collection.IndexType) error

KVCreate does validation checks and calls the create KVtable function.

func (*API) KVDel added in v0.9.1

func (d *API) KVDel(sessionId, podName, name, key string) ([]byte, error)

KVDel does validation checks and calls the delete KVtable function.

func (*API) KVDelete added in v0.9.1

func (d *API) KVDelete(sessionId, podName, name string) error

KVDelete does validation checks and calls the delete KVtable function.

func (*API) KVGet added in v0.9.1

func (d *API) KVGet(sessionId, podName, name, key string) ([]string, []byte, error)

KVGet does validation checks and calls the get KVtable function.

func (*API) KVGetNext added in v0.9.1

func (d *API) KVGetNext(sessionId, podName, name string) ([]string, string, []byte, error)

KVGetNext does validation checks and calls the get next KVtable function.

func (*API) KVList added in v0.9.1

func (d *API) KVList(sessionId, podName string) (map[string][]string, error)

KVList does validation checks and calls the list KVtable function.

func (*API) KVOpen added in v0.9.1

func (d *API) KVOpen(sessionId, podName, name string) error

KVOpen does validation checks and calls the open KVtable function.

func (*API) KVPut added in v0.9.1

func (d *API) KVPut(sessionId, podName, name, key string, value []byte) error

KVPut does validation checks and calls the put KVtable function.

func (*API) KVSeek added in v0.9.1

func (d *API) KVSeek(sessionId, podName, name, start, end string, limit int64) (*collection.Iterator, error)

KVSeek does validation checks and calls the seek KVtable function.

func (*API) ListDir added in v0.9.1

func (d *API) ListDir(podName, currentDir, sessionId string) ([]dir.Entry, []f.Entry, error)

ListDir is a controller function which validates if the user is logged in, pod is open and calls the dir object to list the contents of the supplied directory.

func (*API) ListPods added in v0.9.1

func (d *API) ListPods(sessionId string) ([]string, []string, error)

func (*API) LoginUser

func (d *API) LoginUser(userName, passPhrase, sessionId string) (*user.Info, error)

LoginUser is a controller function which calls the users login function. FOR MIGRATION PURPOSE ONLY

func (*API) LoginUserV2 added in v0.9.1

func (d *API) LoginUserV2(userName, passPhrase, sessionId string) (*user.Info, string, string, error)

LoginUserV2 is a controller function which calls the users login function.

func (*API) LogoutUser added in v0.9.1

func (d *API) LogoutUser(sessionId string) error

LogoutUser is a controller function which gets the logged in user information and logs it out.

func (*API) MigrateUser

func (d *API) MigrateUser(username, passPhrase, sessionId string) error

MigrateUser is a controller function which migrates user credentials to swarm from local storage

func (*API) Mkdir added in v0.9.1

func (d *API) Mkdir(podName, dirToCreateWithPath, sessionId string) error

Mkdir is a controller function which validates if the user is logged in, pod is open and calls the make directory function in the dir object.

func (*API) OpenPod added in v0.9.1

func (d *API) OpenPod(podName, passPhrase, sessionId string) (*pod.Info, error)

func (*API) PodReceive added in v0.9.1

func (d *API) PodReceive(sessionId, sharedPodName string, ref utils.Reference) (*pod.Info, error)

func (*API) PodReceiveInfo added in v0.9.1

func (d *API) PodReceiveInfo(sessionId string, ref utils.Reference) (*pod.ShareInfo, error)

func (*API) PodShare added in v0.9.1

func (d *API) PodShare(podName, sharedPodName, passPhrase, sessionId string) (string, error)

func (*API) PodStat added in v0.9.1

func (d *API) PodStat(podName, sessionId string) (*pod.Stat, error)

func (*API) ReceiveFile added in v0.9.1

func (d *API) ReceiveFile(podName, sessionId string, sharingRef utils.SharingReference, dir string) (string, error)

ReceiveFile is a controller function which validates if the user is logged in, pod is open and calls the ReceiveFile function to get the shared file in to the given pod.

func (*API) ReceiveInfo added in v0.9.1

func (d *API) ReceiveInfo(podName, sessionId string, sharingRef utils.SharingReference) (*user.ReceiveFileInfo, error)

ReceiveInfo is a controller function which validates if the user is logged in, pod is open and calls the ReceiveInfo function to display the shared files information.

func (*API) RmDir added in v0.9.1

func (d *API) RmDir(podName, directoryNameWithPath, sessionId string) error

RmDir is a controller function which validates if the user is logged in, pod is open and calls the dir object to remove the supplied directory.

func (*API) ShareFile added in v0.9.1

func (d *API) ShareFile(podName, podFileWithPath, destinationUser, sessionId string) (string, error)

ShareFile is a controller function which validates if the user is logged in, pod is open and calls the sharefile function.

func (*API) SyncPod added in v0.9.1

func (d *API) SyncPod(podName, sessionId string) error

func (*API) UploadFile added in v0.9.1

func (d *API) UploadFile(podName, podFileName, sessionId string, fileSize int64, fd io.Reader, podPath, compression string, blockSize uint32) error

UploadFile is a controller function which validates if the user is logged in,

pod is open and calls the upload function.

Jump to

Keyboard shortcuts

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