Documentation ¶
Index ¶
- Variables
- type API
- func (a *API) ApproveSubscription(sessionId, podName string, reqHash, nameHash [32]byte) error
- func (a *API) ChangePodListStatusInMarketplace(sessionId string, subHash [32]byte, show bool) error
- func (a *API) ChmodDir(podName, directoryNameWithPath, sessionId string, mode uint32) error
- func (a *API) ChmodFile(podName, podFileWithPath, sessionId string, mode uint32) error
- func (a *API) Close() error
- func (a *API) ClosePod(podName, sessionId string) error
- func (a *API) ConnectPortableAccountWithWallet(userName, passPhrase, addressHex, signature string) error
- func (a *API) CreatePod(podName, sessionId string) (*pod.Info, error)
- func (a *API) CreateUserV2(userName, passPhrase, mnemonic, sessionId string) (*user.SignupResponse, error)
- func (a *API) DecryptAndOpenSubscriptionPod(sessionId, reference string, sellerNameHash [32]byte) (*pod.Info, error)
- func (a *API) DeleteFile(podName, podFileWithPath, sessionId string) error
- func (a *API) DeletePod(podName, sessionId string) error
- func (a *API) DeleteUserV2(passPhrase, sessionId string) error
- func (a *API) DirectoryInode(podName, directoryName, sessionId string) (*dir.Inode, error)
- func (a *API) DirectoryStat(podName, directoryPath, sessionId string) (*dir.Stats, error)
- func (a *API) DocBatch(sessionId, podName, name string) (*collection.DocBatch, error)
- func (a *API) DocBatchPut(sessionId, podName string, doc []byte, docBatch *collection.DocBatch) error
- func (a *API) DocBatchWrite(sessionId, podName string, docBatch *collection.DocBatch) error
- func (a *API) DocCount(sessionId, podName, name, expr string) (*collection.TableKeyCount, error)
- func (a *API) DocCreate(sessionId, podName, name string, indexes map[string]collection.IndexType, ...) error
- func (a *API) DocDel(sessionId, podName, name, id string) error
- func (a *API) DocDelete(sessionId, podName, name string) error
- func (a *API) DocFind(sessionId, podName, name, expr string, limit int) ([][]byte, error)
- func (a *API) DocGet(sessionId, podName, name, id string) ([]byte, error)
- func (a *API) DocIndexJson(sessionId, podName, name, podFileWithPath string) error
- func (a *API) DocList(sessionId, podName string) (map[string]collection.DBSchema, error)
- func (a *API) DocOpen(sessionId, podName, name string) error
- func (a *API) DocPut(sessionId, podName, name string, value []byte) error
- func (a *API) DownloadFile(podName, podFileWithPath, sessionId string) (io.ReadCloser, uint64, error)
- func (a *API) EncryptSubscription(sessionId, podName string, nameHash [32]byte) (string, error)
- func (a *API) FileStat(podName, podFileWithPath, sessionId string) (*f.Stats, error)
- func (a *API) ForkPod(podName, forkName, sessionId string) error
- func (a *API) ForkPodFromRef(forkName, refString, sessionId string) error
- func (a *API) GetNameHash(sessionId, username string) ([32]byte, error)
- func (a *API) GetSubsRequests(sessionId string) ([]datahub.DataHubSubRequest, error)
- func (a *API) GetSubscribablePodInfo(sessionId string, subHash [32]byte) (*rpc.SubscriptionItemInfo, error)
- func (a *API) GetSubscribablePods(sessionId string) ([]datahub.DataHubSub, error)
- func (a *API) GetSubscriptions(sessionId string) ([]SubscriptionInfo, error)
- func (a *API) GetUserStat(sessionId string) (*user.Stat, error)
- func (a *API) IsDBOpened(sessionId, podName, name string) (bool, error)
- func (a *API) IsDirPresent(podName, directoryNameWithPath, sessionId string) (bool, error)
- func (a *API) IsPodExist(podName, sessionId string) bool
- func (a *API) IsUserLoggedIn(userName string) bool
- func (a *API) IsUserNameAvailableV2(userName string) bool
- func (a *API) KVBatch(sessionId, podName, name string, columns []string) (*collection.Batch, error)
- func (a *API) KVBatchPut(sessionId, podName, key string, value []byte, batch *collection.Batch) error
- func (a *API) KVBatchWrite(sessionId, podName string, batch *collection.Batch) error
- func (a *API) KVCount(sessionId, podName, name string) (*collection.TableKeyCount, error)
- func (a *API) KVCreate(sessionId, podName, name string, indexType collection.IndexType) error
- func (a *API) KVDel(sessionId, podName, name, key string) ([]byte, error)
- func (a *API) KVDelete(sessionId, podName, name string) error
- func (a *API) KVGet(sessionId, podName, name, key string) ([]string, []byte, error)
- func (a *API) KVGetNext(sessionId, podName, name string) ([]string, string, []byte, error)
- func (a *API) KVList(sessionId, podName string) (map[string][]string, error)
- func (a *API) KVOpen(sessionId, podName, name string) error
- func (a *API) KVPut(sessionId, podName, name, key string, value []byte) error
- func (a *API) KVSeek(sessionId, podName, name, start, end string, limit int64) (*collection.Iterator, error)
- func (a *API) ListDir(podName, currentDir, sessionId string) ([]dir.Entry, []f.Entry, error)
- func (a *API) ListPodInMarketplace(sessionId, podName, title, desc, thumbnail string, price uint64, ...) error
- func (a *API) ListPods(sessionId string) ([]string, []string, error)
- func (a *API) LoadLiteUser(userName, passPhrase, mnemonic, sessionId string) (string, string, *user.Info, error)
- func (a *API) LoginUserV2(userName, passPhrase, sessionId string) (*user.LoginResponse, error)
- func (a *API) LoginWithWallet(addressHex, signature, sessionId string) (*user.Info, string, error)
- func (a *API) LogoutUser(sessionId string) error
- func (a *API) Mkdir(podName, dirToCreateWithPath, sessionId string, mode uint32) error
- func (a *API) OpenPod(podName, sessionId string) (*pod.Info, error)
- func (a *API) OpenSubscribedPod(sessionId string, subHash [32]byte, infoLocation string) (*pod.Info, error)
- func (a *API) PodList(sessionId string) (*pod.List, error)
- func (a *API) PodReceive(sessionId, sharedPodName string, ref utils.Reference) (*pod.Info, error)
- func (a *API) PodReceiveInfo(sessionId string, ref utils.Reference) (*pod.ShareInfo, error)
- func (a *API) PodShare(podName, sharedPodName, sessionId string) (string, error)
- func (a *API) PodStat(podName, sessionId string) (*pod.Stat, error)
- func (a *API) PublicPodDisLs(pod *pod.ShareInfo, dirPathToLs string) ([]dir.Entry, []file.Entry, error)
- func (a *API) PublicPodFileDownload(pod *pod.ShareInfo, filePath string) (io.ReadCloser, uint64, error)
- func (a *API) PublicPodKVEntryGet(pod *pod.ShareInfo, name, key string) ([]string, []byte, error)
- func (a *API) PublicPodKVGetter(pod *pod.ShareInfo) KVGetter
- func (a *API) PublicPodReceiveInfo(ref utils.Reference) (*pod.ShareInfo, error)
- func (a *API) ReadSeekCloser(podName, podFileWithPath, sessionId string) (io.ReadSeekCloser, uint64, error)
- func (a *API) ReceiveFile(podName, sessionId, ref, dir string) (string, error)
- func (a *API) ReceiveInfo(sessionId, ref string) (*user.ReceiveFileInfo, error)
- func (a *API) RenameDir(podName, dirToRenameWithPath, newName, sessionId string) error
- func (a *API) RenameFile(podName, fileNameWithPath, newFileNameWithPath, sessionId string) error
- func (a *API) RequestSubscription(sessionId string, subHash [32]byte) error
- func (a *API) RmDir(podName, directoryNameWithPath, sessionId string) error
- func (a *API) ShareFile(podName, podFileWithPath, destinationUser, sessionId string) (string, error)
- func (a *API) StatusFile(podName, podFileWithPath, sessionId string) (int64, int64, int64, error)
- func (a *API) SyncPod(podName, sessionId string) error
- func (a *API) SyncPodAsync(ctx context.Context, podName, sessionId string) error
- func (a *API) UploadFile(podName, podFileName, sessionId string, fileSize int64, fd io.Reader, ...) error
- func (a *API) WriteAtFile(podName, fileNameWithPath, sessionId string, update io.Reader, offset uint64, ...) (int, error)
- type KVGetter
- type Options
- type SubscriptionInfo
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") // ErrFileAlreadyPresent indicates file is already present ErrFileAlreadyPresent = errors.New("file already exist with new name") )
Functions ¶
This section is empty.
Types ¶
type API ¶ added in v0.9.1
API is the go api for fairOS
func NewMockDfsAPI ¶ added in v0.9.1
NewMockDfsAPI is used for tests only
func (*API) ApproveSubscription ¶ added in v0.9.3
ApproveSubscription approves a subscription to a pod
func (*API) ChangePodListStatusInMarketplace ¶ added in v0.9.3
ChangePodListStatusInMarketplace changes the status of a pod in the datahub marketplace
func (*API) ChmodDir ¶ added in v0.9.2
ChmodDir is a controller function which validates if the user is logged-in, pod is open and calls changes mode of a directory
func (*API) ChmodFile ¶ added in v0.9.2
ChmodFile is a controller function which validates if the user is logged-in, pod is open and calls changes mode of a file
func (*API) ConnectPortableAccountWithWallet ¶ added in v0.9.3
func (a *API) ConnectPortableAccountWithWallet(userName, passPhrase, addressHex, signature string) error
ConnectPortableAccountWithWallet is a controller function which calls the users login function.
func (*API) CreateUserV2 ¶ added in v0.9.1
func (a *API) CreateUserV2(userName, passPhrase, mnemonic, sessionId string) (*user.SignupResponse, error)
CreateUserV2 is a controller function which calls the create user function from the user object.
func (*API) DecryptAndOpenSubscriptionPod ¶ added in v0.9.3
func (a *API) DecryptAndOpenSubscriptionPod(sessionId, reference string, sellerNameHash [32]byte) (*pod.Info, error)
DecryptAndOpenSubscriptionPod decrypts pod info and opens the subscription pod
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 removes the file entry from the parent directory.
func (*API) DeleteUserV2 ¶ added in v0.9.1
DeleteUserV2 is a controller function which deletes a logged-in user.
func (*API) DirectoryInode ¶ added in v0.9.1
DirectoryInode is a controller function which validates if the user is logged-in, pod is open and calls the dir object to get the inode info about the given directory.
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 (a *API) DocBatch(sessionId, podName, name string) (*collection.DocBatch, error)
DocBatch initiates a batch inserting session.
func (*API) DocBatchPut ¶ added in v0.9.1
func (a *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 (a *API) DocBatchWrite(sessionId, podName string, docBatch *collection.DocBatch) error
DocBatchWrite commits the batch document insert.
func (*API) DocCount ¶ added in v0.9.1
func (a *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 (a *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 (a *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) EncryptSubscription ¶ added in v0.9.3
EncryptSubscription encrypts the subscription information
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) ForkPodFromRef ¶ added in v0.9.2
ForkPodFromRef forks a pod from a sharing reference
func (*API) GetNameHash ¶ added in v0.9.3
GetNameHash returns the nameHash of the username
func (*API) GetSubsRequests ¶ added in v0.9.3
func (a *API) GetSubsRequests(sessionId string) ([]datahub.DataHubSubRequest, error)
GetSubsRequests returns the list of subscription requests
func (*API) GetSubscribablePodInfo ¶ added in v0.9.3
func (a *API) GetSubscribablePodInfo(sessionId string, subHash [32]byte) (*rpc.SubscriptionItemInfo, error)
GetSubscribablePodInfo returns the subscribable pod info
func (*API) GetSubscribablePods ¶ added in v0.9.3
func (a *API) GetSubscribablePods(sessionId string) ([]datahub.DataHubSub, error)
GetSubscribablePods returns the list of subscribable pods
func (*API) GetSubscriptions ¶ added in v0.9.3
func (a *API) GetSubscriptions(sessionId string) ([]SubscriptionInfo, error)
GetSubscriptions returns the list of subscriptions
func (*API) GetUserStat ¶ added in v0.9.1
GetUserStat gets the information related to the user.
func (*API) IsDBOpened ¶ added in v0.10.0
IsDBOpened is a controller function which checks if documentDB is open
func (*API) IsDirPresent ¶ added in v0.9.1
IsDirPresent is a controller 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
IsPodExist checks if a pod exists
func (*API) IsUserLoggedIn ¶ added in v0.9.1
IsUserLoggedIn checks if the given user is logged-in
func (*API) IsUserNameAvailableV2 ¶ added in v0.9.1
IsUserNameAvailableV2 checks if a given username 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 (a *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 (a *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 (a *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 (a *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 (a *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) ListPodInMarketplace ¶ added in v0.9.3
func (a *API) ListPodInMarketplace(sessionId, podName, title, desc, thumbnail string, price uint64, daysValid uint16, category [32]byte) error
ListPodInMarketplace lists a pod in the datahub marketplace
func (*API) LoadLiteUser ¶ added in v0.9.2
func (a *API) LoadLiteUser(userName, passPhrase, mnemonic, sessionId string) (string, string, *user.Info, error)
LoadLiteUser is a controller function which loads user from mnemonic and doesn't store any user info on chain
func (*API) LoginUserV2 ¶ added in v0.9.1
func (a *API) LoginUserV2(userName, passPhrase, sessionId string) (*user.LoginResponse, error)
LoginUserV2 is a controller function which calls the users login function.
func (*API) LoginWithWallet ¶ added in v0.9.3
LoginWithWallet 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) 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) OpenSubscribedPod ¶ added in v0.9.3
func (a *API) OpenSubscribedPod(sessionId string, subHash [32]byte, infoLocation string) (*pod.Info, error)
OpenSubscribedPod opens the subscribed pod
func (*API) PodReceive ¶ added in v0.9.1
PodReceive - receive a pod from a sharingReference
func (*API) PodReceiveInfo ¶ added in v0.9.1
PodReceiveInfo receives the pod information
func (*API) PublicPodDisLs ¶ added in v0.9.3
func (a *API) PublicPodDisLs(pod *pod.ShareInfo, dirPathToLs string) ([]dir.Entry, []file.Entry, error)
PublicPodDisLs lists a directory from a public pod
func (*API) PublicPodFileDownload ¶ added in v0.9.3
func (a *API) PublicPodFileDownload(pod *pod.ShareInfo, filePath string) (io.ReadCloser, uint64, error)
PublicPodFileDownload downloads a file from a public pod
func (*API) PublicPodKVEntryGet ¶ added in v0.9.3
PublicPodKVEntryGet gets a kv entry from a public pod
func (*API) PublicPodKVGetter ¶ added in v0.10.0
PublicPodKVGetter gets a kv store getter interface
func (*API) PublicPodReceiveInfo ¶ added in v0.9.3
PublicPodReceiveInfo receives the pod information for a public pod
func (*API) ReadSeekCloser ¶ added in v0.9.1
func (a *API) ReadSeekCloser(podName, podFileWithPath, sessionId string) (io.ReadSeekCloser, uint64, error)
ReadSeekCloser is a controller function which validates if the user is logged-in, pod is open and calls the download function.
func (*API) ReceiveFile ¶ added in v0.9.1
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 (a *API) ReceiveInfo(sessionId, ref string) (*user.ReceiveFileInfo, error)
ReceiveInfo is a controller function which validates if the user is logged-in, calls the ReceiveInfo function to display the shared file's information.
func (*API) RenameDir ¶ added in v0.9.1
RenameDir is a controller function which validates if the user is logged-in, pod is open and calls the rename directory function in the dir object.
func (*API) RenameFile ¶ added in v0.9.1
RenameFile is a controller function which validates if the user is logged-in,
pod is open and calls renaming of a file
func (*API) RequestSubscription ¶ added in v0.9.3
RequestSubscription requests a subscription to a pod
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 (a *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) StatusFile ¶ added in v0.9.2
StatusFile is a controller function which validates if the user is logged-in, pod is open and calls the sync status of file function.
func (*API) SyncPodAsync ¶ added in v0.9.2
SyncPodAsync syncs a pod asynchronously
func (*API) UploadFile ¶ added in v0.9.1
func (a *API) UploadFile(podName, podFileName, sessionId string, fileSize int64, fd io.Reader, podPath, compression string, blockSize, mode uint32, overwrite bool) error
UploadFile is a controller function which validates if the user is logged-in,
pod is open and calls the upload function.