dfs

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserNotLoggedIn = errors.New("user not logged in")
	ErrInvalidUserName = errors.New("invalid user name")
	ErrPodNotOpen      = errors.New("pod not open")
	ErrPodAlreadyOpen  = errors.New("pod already open")
	ErrBeeClient       = errors.New("could not connect to bee client")
	ErrReadOnlyPod     = errors.New("operation not permitted: read only pod")
	ErrFileNotPresent  = errors.New("file not present")
)

Functions

This section is empty.

Types

type DfsAPI

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

func NewDfsAPI

func NewDfsAPI(dataDir, host, port, cookieDomain, postageBlockId string, logger logging.Logger) (*DfsAPI, error)

NewDfsAPI is the main entry point for the df controller.

func (*DfsAPI) ClosePod

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

func (*DfsAPI) CreatePod

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

func (*DfsAPI) CreateUser

func (d *DfsAPI) CreateUser(userName, passPhrase, mnemonic string, response http.ResponseWriter, sessionId string) (string, string, error)

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

func (*DfsAPI) DeleteFile

func (d *DfsAPI) 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 (*DfsAPI) DeletePod

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

func (*DfsAPI) DeleteUser

func (d *DfsAPI) DeleteUser(passPhrase, sessionId string, response http.ResponseWriter) error

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

func (*DfsAPI) DirectoryStat

func (d *DfsAPI) DirectoryStat(podName, directoryName, sessionId string) (*dir.DirStats, 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 (*DfsAPI) DocBatch

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

DocBatch initiates a batch inserting session.

func (*DfsAPI) DocBatchPut

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

DocBatchPut inserts records in to a document batch.

func (*DfsAPI) DocBatchWrite

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

DocBatchWrite commits the batch document insert.

func (*DfsAPI) DocCount

func (d *DfsAPI) DocCount(sessionId, podName, name, expr string) (uint64, error)

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

func (*DfsAPI) DocCreate

func (d *DfsAPI) 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 (*DfsAPI) DocDel

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

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

func (*DfsAPI) DocDelete

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

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

func (*DfsAPI) DocFind

func (d *DfsAPI) 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 (*DfsAPI) DocGet

func (d *DfsAPI) 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 (*DfsAPI) DocIndexJson

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

DocIndexJson indexes a json files in to the document DB.

func (*DfsAPI) DocList

func (d *DfsAPI) 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 (*DfsAPI) DocOpen

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

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

func (*DfsAPI) DocPut

func (d *DfsAPI) 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 (*DfsAPI) DownloadFile

func (d *DfsAPI) 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 (*DfsAPI) ExportUser

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

ExportUser exports the currently logged in user.

func (*DfsAPI) FileStat

func (d *DfsAPI) 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 (*DfsAPI) GetUserStat

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

GetUserStat gets the information related to the user.

func (*DfsAPI) ImportUserUsingAddress

func (d *DfsAPI) ImportUserUsingAddress(userName, passPhrase, address string, response http.ResponseWriter, sessionId string) error

ImportUserUsingAddress is a controller function which calls the create user using the address passed.

func (*DfsAPI) ImportUserUsingMnemonic

func (d *DfsAPI) ImportUserUsingMnemonic(userName, passPhrase, mnemonic string, response http.ResponseWriter, sessionId string) (string, error)

ImportUserUsingMnemonic is a controller function which calls the create user using the mnemonic passed.

func (*DfsAPI) IsDirPresent

func (d *DfsAPI) 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 (*DfsAPI) IsUserLoggedIn

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

IsUserLoggedIn checks if the given user is logged in

func (*DfsAPI) IsUserNameAvailable

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

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

func (*DfsAPI) KVBatch

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

KVBatch does validation checks and calls the batch KVtable function.

func (*DfsAPI) KVBatchPut

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

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

func (*DfsAPI) KVBatchWrite

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

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

func (*DfsAPI) KVCount

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

KVCount does validation checks and calls the count KVtable function.

func (*DfsAPI) KVCreate

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

KVCreate does validation checks and calls the create KVtable function.

func (*DfsAPI) KVDel

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

KVDel does validation checks and calls the delete KVtable function.

func (*DfsAPI) KVDelete

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

KVDelete does validation checks and calls the delete KVtable function.

func (*DfsAPI) KVGet

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

KVGet does validation checks and calls the get KVtable function.

func (*DfsAPI) KVGetNext

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

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

func (*DfsAPI) KVList

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

KVList does validation checks and calls the list KVtable function.

func (*DfsAPI) KVOpen

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

KVOpen does validation checks and calls the open KVtable function.

func (*DfsAPI) KVPut

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

KVPut does validation checks and calls the put KVtable function.

func (*DfsAPI) KVSeek

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

KVSeek does validation checks and calls the seek KVtable function.

func (*DfsAPI) ListDir

func (d *DfsAPI) 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 (*DfsAPI) ListPods

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

func (*DfsAPI) LoginUser

func (d *DfsAPI) LoginUser(userName, passPhrase string, response http.ResponseWriter, sessionId string) error

LoginUser is a controller function which calles the users login function.

func (*DfsAPI) LogoutUser

func (d *DfsAPI) LogoutUser(sessionId string, response http.ResponseWriter) error

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

func (*DfsAPI) Mkdir

func (d *DfsAPI) 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 (*DfsAPI) OpenPod

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

func (*DfsAPI) PodReceive

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

func (*DfsAPI) PodReceiveInfo

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

func (*DfsAPI) PodShare

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

func (*DfsAPI) PodStat

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

func (*DfsAPI) ReceiveFile

func (d *DfsAPI) 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 (*DfsAPI) ReceiveInfo

func (d *DfsAPI) 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 (*DfsAPI) RmDir

func (d *DfsAPI) 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 (*DfsAPI) ShareFile

func (d *DfsAPI) 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 (*DfsAPI) SyncPod

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

func (*DfsAPI) UploadFile

func (d *DfsAPI) 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