Documentation ¶
Index ¶
- Variables
- type DfsAPI
- func (d *DfsAPI) ClosePod(podName, sessionId string) error
- func (d *DfsAPI) CreatePod(podName, passPhrase, sessionId string) (*pod.Info, error)
- func (d *DfsAPI) CreateUser(userName, passPhrase, mnemonic string, response http.ResponseWriter, ...) (string, string, error)
- func (d *DfsAPI) DeleteFile(podName, podFileWithPath, sessionId string) error
- func (d *DfsAPI) DeletePod(podName, passphrase, sessionId string) error
- func (d *DfsAPI) DeleteUser(passPhrase, sessionId string, response http.ResponseWriter) error
- func (d *DfsAPI) DirectoryStat(podName, directoryName, sessionId string) (*dir.DirStats, error)
- func (d *DfsAPI) DocBatch(sessionId, podName, name string) (*collection.DocBatch, error)
- func (d *DfsAPI) DocBatchPut(sessionId, podName string, doc []byte, docBatch *collection.DocBatch) error
- func (d *DfsAPI) DocBatchWrite(sessionId, podName string, docBatch *collection.DocBatch) error
- func (d *DfsAPI) DocCount(sessionId, podName, name, expr string) (uint64, error)
- func (d *DfsAPI) DocCreate(sessionId, podName, name string, indexes map[string]collection.IndexType, ...) error
- func (d *DfsAPI) DocDel(sessionId, podName, name, id string) error
- func (d *DfsAPI) DocDelete(sessionId, podName, name string) error
- func (d *DfsAPI) DocFind(sessionId, podName, name, expr string, limit int) ([][]byte, error)
- func (d *DfsAPI) DocGet(sessionId, podName, name, id string) ([]byte, error)
- func (d *DfsAPI) DocIndexJson(sessionId, podName, name, podFileWithPath string) error
- func (d *DfsAPI) DocList(sessionId, podName string) (map[string]collection.DBSchema, error)
- func (d *DfsAPI) DocOpen(sessionId, podName, name string) error
- func (d *DfsAPI) DocPut(sessionId, podName, name string, value []byte) error
- func (d *DfsAPI) DownloadFile(podName, podFileWithPath, sessionId string) (io.ReadCloser, uint64, error)
- func (d *DfsAPI) ExportUser(sessionId string) (string, string, error)
- func (d *DfsAPI) FileStat(podName, podFileWithPath, sessionId string) (*f.Stats, error)
- func (d *DfsAPI) GetUserStat(sessionId string) (*user.Stat, error)
- func (d *DfsAPI) ImportUserUsingAddress(userName, passPhrase, address string, response http.ResponseWriter, ...) error
- func (d *DfsAPI) ImportUserUsingMnemonic(userName, passPhrase, mnemonic string, response http.ResponseWriter, ...) (string, error)
- func (d *DfsAPI) IsDirPresent(podName, directoryNameWithPath, sessionId string) (bool, error)
- func (d *DfsAPI) IsUserLoggedIn(userName string) bool
- func (d *DfsAPI) IsUserNameAvailable(userName string) bool
- func (d *DfsAPI) KVBatch(sessionId, podName, name string, columns []string) (*collection.Batch, error)
- func (d *DfsAPI) KVBatchPut(sessionId, podName, key string, value []byte, batch *collection.Batch) error
- func (d *DfsAPI) KVBatchWrite(sessionId, podName string, batch *collection.Batch) error
- func (d *DfsAPI) KVCount(sessionId, podName, name string) (*collection.KVCount, error)
- func (d *DfsAPI) KVCreate(sessionId, podName, name string, indexType collection.IndexType) error
- func (d *DfsAPI) KVDel(sessionId, podName, name, key string) ([]byte, error)
- func (d *DfsAPI) KVDelete(sessionId, podName, name string) error
- func (d *DfsAPI) KVGet(sessionId, podName, name, key string) ([]string, []byte, error)
- func (d *DfsAPI) KVGetNext(sessionId, podName, name string) ([]string, string, []byte, error)
- func (d *DfsAPI) KVList(sessionId, podName string) (map[string][]string, error)
- func (d *DfsAPI) KVOpen(sessionId, podName, name string) error
- func (d *DfsAPI) KVPut(sessionId, podName, name, key string, value []byte) error
- func (d *DfsAPI) KVSeek(sessionId, podName, name, start, end string, limit int64) (*collection.Iterator, error)
- func (d *DfsAPI) ListDir(podName, currentDir, sessionId string) ([]dir.Entry, []f.Entry, error)
- func (d *DfsAPI) ListPods(sessionId string) ([]string, []string, error)
- func (d *DfsAPI) LoginUser(userName, passPhrase string, response http.ResponseWriter, sessionId string) error
- func (d *DfsAPI) LogoutUser(sessionId string, response http.ResponseWriter) error
- func (d *DfsAPI) Mkdir(podName, dirToCreateWithPath, sessionId string) error
- func (d *DfsAPI) OpenPod(podName, passPhrase, sessionId string) (*pod.Info, error)
- func (d *DfsAPI) PodReceive(sessionId string, ref utils.Reference) (*pod.Info, error)
- func (d *DfsAPI) PodReceiveInfo(sessionId string, ref utils.Reference) (*pod.ShareInfo, error)
- func (d *DfsAPI) PodShare(podName, passPhrase, sessionId string) (string, error)
- func (d *DfsAPI) PodStat(podName, sessionId string) (*pod.PodStat, error)
- func (d *DfsAPI) ReceiveFile(podName, sessionId string, sharingRef utils.SharingReference, dir string) (string, error)
- func (d *DfsAPI) ReceiveInfo(podName, sessionId string, sharingRef utils.SharingReference) (*user.ReceiveFileInfo, error)
- func (d *DfsAPI) RmDir(podName, directoryNameWithPath, sessionId string) error
- func (d *DfsAPI) ShareFile(podName, podFileWithPath, destinationUser, sessionId string) (string, error)
- func (d *DfsAPI) SyncPod(podName, sessionId string) error
- func (d *DfsAPI) UploadFile(podName, podFileName, sessionId string, fileSize int64, fd io.Reader, ...) error
Constants ¶
This section is empty.
Variables ¶
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) 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 ¶
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) 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 ¶
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 ¶
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 ¶
DocDel is a controller function which does all the checks before deleting a documentDB.
func (*DfsAPI) DocDelete ¶
DocDelete is a controller function which does all the checks before deleting a documentDB.
func (*DfsAPI) DocFind ¶
DocFind is a controller function which does all the checks before finding records from a documentDB.
func (*DfsAPI) DocGet ¶
DocGet is a controller function which does all the checks before retrieving // a document in the documentDB.
func (*DfsAPI) DocIndexJson ¶
DocIndexJson indexes a json files in to the document DB.
func (*DfsAPI) DocList ¶
DocList is a controller function which does all the checks before listing all the documentDB available in the pod.
func (*DfsAPI) DocOpen ¶
DocOpen is a controller function which does all the checks before opening a documentDB.
func (*DfsAPI) DocPut ¶
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 ¶
ExportUser exports the currently logged in user.
func (*DfsAPI) FileStat ¶
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 ¶
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 ¶
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 ¶
IsUserLoggedIn checks if the given user is logged in
func (*DfsAPI) IsUserNameAvailable ¶
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) KVGetNext ¶
KVGetNext does validation checks and calls the get next 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 ¶
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) 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 ¶
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) PodReceive ¶
func (*DfsAPI) PodReceiveInfo ¶
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 ¶
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.