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