Documentation ¶
Overview ¶
Package user provides the client platform for user.
Index ¶
- type Client
- func (c *Client) ChangePWD(dst string) error
- func (c *Client) CreateDirectory(p string) error
- func (c *Client) CreateDirectoryWithFiles(src, dst string, dataShards, parShards int) error
- func (c *Client) CreateFile(src, dst string, dataShards, parShards int) error
- func (c *Client) DeleteDirectory(p string) error
- func (c *Client) DeleteFile(p string) error
- func (c *Client) DownloadFiles(p, dst string)
- func (c *Client) DownloadSharedFiles(p, dst, ownerAddr, ownerPub string)
- func (c *Client) GetINode(p string) (tpStorage.INode, error)
- func (c *Client) GetOtherSharedINode(owner, p string) (tpStorage.INode, error)
- func (c *Client) GetSharedINode(p string) (tpStorage.INode, error)
- func (c *Client) GetSize() int64
- func (c *Client) ListDirectory(p string) ([]tpStorage.INodeInfo, error)
- func (c *Client) ListOtherSharedDirectory(owner, p string) ([]tpStorage.INodeInfo, error)
- func (c *Client) ListSharedDirectory(p string) ([]tpStorage.INodeInfo, error)
- func (c *Client) ListUsersShared(other bool) error
- func (c *Client) Move(src, dst string) error
- func (c *Client) PublishKey(p string) error
- func (c *Client) Rename(src, newName string) error
- func (c *Client) ShareFiles(src, dst string) ([]string, error)
- func (c *Client) Sync() error
- func (c *Client) UserRegister() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { User *tpUser.User PWD string QueryCache map[string]*tpUser.User *p2p.UserNode *lib.ClientFramework // contains filtered or unexported fields }
Client provides the platform for user storing files in P2P network.
func NewUserClient ¶
NewUserClient is the construct for User's Client.
func (*Client) CreateDirectory ¶
CreateDirectory create new directory of the path and send transaction.
func (*Client) CreateDirectoryWithFiles ¶
CreateDirectoryWithFiles upload directory and files in it from source path in system to destination path.
func (*Client) CreateFile ¶
CreateFile create new file of the source. After sending transaction, upload file into P2P network.
func (*Client) DeleteDirectory ¶
DeleteDirectory delete directory of the path in 'home' directory and files under it. After delete it, send transaction.
func (*Client) DeleteFile ¶
DeleteFile delete the target file, then send transaction.
func (*Client) DownloadFiles ¶
DownloadFiles download the file or directory to destination path in system.
func (*Client) DownloadSharedFiles ¶
DownloadSharedFiles download the file or directory in 'shared' directory of owner to destination path in system.
func (*Client) GetINode ¶
GetINode returns the iNode of the path in 'home' directory. If error is not nil, it will return.
func (*Client) GetOtherSharedINode ¶
GetOtherSharedINode returns the iNode of user's shared files. If error is not nil, it will return.
func (*Client) GetSharedINode ¶
GetSharedINode returns the iNode of the path in 'shared' directory. If error is not nil, it will return./
func (*Client) ListDirectory ¶
ListDirectory returns the information of iNodes in the path of 'home' directory.
func (*Client) ListOtherSharedDirectory ¶
ListOtherSharedDirectory returns the list of user's shared directory. If error is not nil, it will return.
func (*Client) ListSharedDirectory ¶
ListSharedDirectory returns the information of iNodes in the path of 'shared' directory.
func (*Client) ListUsersShared ¶
ListUsersShared get the query cache for list shared files.
func (*Client) PublishKey ¶
PublishKey publish keys of the files in the path.
func (*Client) ShareFiles ¶
ShareFiles share the files from 'home' directory to 'shared' directory.
func (*Client) UserRegister ¶
UserRegister register user in the blockchain.