Versions in this module Expand all Collapse all v0 v0.0.1 Feb 20, 2019 Changes in this version + const ANTOAN_GET_VERSION + const ANTOAN_NOP + const ANTOCS_GET_CHUNK_CHECKSUM + const ANTOCS_GET_CHUNK_CHECKSUM_TAB + const CHUNKOPFLAG_CANMODTIME + const CHUNKOPFLAG_CANUSERESERVESPACE + const CHUNKOPFLAG_CONTINUEOP + const CLTOCS_READ + const CLTOCS_WRITE + const CLTOCS_WRITE_DATA + const CLTOCS_WRITE_FINISH + const CLTOMA_FUSE_ACCESS + const CLTOMA_FUSE_APPEND_SLICE + const CLTOMA_FUSE_ARCHCTL + const CLTOMA_FUSE_CHECK + const CLTOMA_FUSE_CREATE + const CLTOMA_FUSE_FLOCK + const CLTOMA_FUSE_FSYNC + const CLTOMA_FUSE_GETATTR + const CLTOMA_FUSE_GETDETACHEDATTR + const CLTOMA_FUSE_GETDIRSTATS + const CLTOMA_FUSE_GETEATTR + const CLTOMA_FUSE_GETFACL + const CLTOMA_FUSE_GETSCLASS + const CLTOMA_FUSE_GETSUSTAINED + const CLTOMA_FUSE_GETTRASH + const CLTOMA_FUSE_GETTRASHPATH + const CLTOMA_FUSE_GETTRASHTIME + const CLTOMA_FUSE_GETXATTR + const CLTOMA_FUSE_LINK + const CLTOMA_FUSE_LOOKUP + const CLTOMA_FUSE_MKDIR + const CLTOMA_FUSE_MKNOD + const CLTOMA_FUSE_OPEN + const CLTOMA_FUSE_PARENTS + const CLTOMA_FUSE_PATHS + const CLTOMA_FUSE_POSIX_LOCK + const CLTOMA_FUSE_PURGE + const CLTOMA_FUSE_QUOTACONTROL + const CLTOMA_FUSE_READDIR + const CLTOMA_FUSE_READLINK + const CLTOMA_FUSE_READ_CHUNK + const CLTOMA_FUSE_REGISTER + const CLTOMA_FUSE_RENAME + const CLTOMA_FUSE_REPAIR + const CLTOMA_FUSE_RMDIR + const CLTOMA_FUSE_SETATTR + const CLTOMA_FUSE_SETEATTR + const CLTOMA_FUSE_SETFACL + const CLTOMA_FUSE_SETSCLASS + const CLTOMA_FUSE_SETTRASHPATH + const CLTOMA_FUSE_SETTRASHTIME + const CLTOMA_FUSE_SETXATTR + const CLTOMA_FUSE_SNAPSHOT + const CLTOMA_FUSE_STATFS + const CLTOMA_FUSE_SYMLINK + const CLTOMA_FUSE_TRUNCATE + const CLTOMA_FUSE_UNDEL + const CLTOMA_FUSE_UNLINK + const CLTOMA_FUSE_WRITE_CHUNK + const CLTOMA_FUSE_WRITE_CHUNK_END + const CLTOMA_INFO + const CLTOMA_QUOTA_INFO + const CLTOMA_SESSION_COMMAND + const CLTOMA_SESSION_LIST + const CSTOAN_CHUNK_CHECKSUM + const CSTOAN_CHUNK_CHECKSUM_TAB + const CSTOCL_READ_DATA + const CSTOCL_READ_STATUS + const CSTOCL_WRITE_STATUS + const FUSE_REGISTER_BLOB_ACL + const MASTER_HEARTBEAT_INTERVAL + const MFSBLOCKBITS + const MFSBLOCKMASK + const MFSBLOCKNEGMASK + const MFSBLOCKSINCHUNK + const MFSBLOCKSIZE + const MFSCHUNKBITS + const MFSCHUNKBLOCKMASK + const MFSCHUNKMASK + const MFSCHUNKSIZE + const MFSCRCEMPTY + const MFSHDRSIZE + const MFS_NAME_MAX + const MFS_PATH_MAX + const MFS_ROOT_ID + const MFS_SYMLINK_MAX + const MFS_VERSION + const MIN_SPECIAL_INODE + const REGISTER_CLOSESESSION + const REGISTER_GETRANDOM + const REGISTER_NEWMETASESSION + const REGISTER_NEWSESSION + const REGISTER_RECONNECT + const REGISTER_TOOLS + const SET_ATIME_FLAG + const SET_ATIME_NOW_FLAG + const SET_GID_FLAG + const SET_MODE_FLAG + const SET_MTIME_FLAG + const SET_MTIME_NOW_FLAG + const SET_UID_FLAG + const SET_WINATTR_FLAG + const TCP_CONNECT_TIMEOUT + const TCP_RETRY_TIMES + const TCP_RW_TIMEOUT + const TYPE_BLOCKDEV + const TYPE_CHARDEV + const TYPE_DIRECTORY + const TYPE_FIFO + const TYPE_FILE + const TYPE_SOCKET + const TYPE_SUSTAINED + const TYPE_SYMLINK + const TYPE_TRASH + var ERROR_TABLE = []string + func FormatBytes(b float64, mode Mode) string + func MFSStrerror(code uint8) string + func Pack(data ...interface{}) []byte + func PackCmd(cmd uint32, data ...interface{}) []byte + func ParseBytes(str string) (uint64, error) + func UnPack(in []byte, out ...interface{}) + type CSClient struct + func NewCSClient(t *CSItem) (c *CSClient, err error) + func (c *CSClient) Close() + func (c *CSClient) Recv(buf []byte) (n int, err error) + func (c *CSClient) Send(msg []byte) error + type CSData struct + CSItems CSItemMap + ChunkId uint64 + Length uint64 + ProtocolId uint8 + Version uint32 + func (d *CSData) Read(buf []byte, off uint64) (n uint32, err error) + func (d *CSData) ReadBlock(c *CSClient, buf []byte, off uint64) (n uint32, err error) + func (d *CSData) Write(buf []byte, off uint64) (n uint32, err error) + func (d *CSData) WriteBlock(c *CSClient, wid uint32, blockNum, off uint16, buf []byte) (err error) + type CSItem struct + Ip uint32 + LabelMask uint32 + Port uint16 + Version uint32 + type CSItemMap map[uint32]*CSItem + type CSPool struct + func NewCSPool() *CSPool + func (p *CSPool) Close() + func (p *CSPool) Get(t *CSItem) (c *CSClient, err error) + func (p *CSPool) Put(c *CSClient) + type Client struct + Cwd string + func NewCLient() (c *Client, err error) + func NewClientFull(addr, password, subDir string) (c *Client, err error) + func (c *Client) Chdir(path string) (err error) + func (c *Client) Chmod(path string, mode uint16) (fi *FileInfo, err error) + func (c *Client) Chown(path string, uid, gid uint32) (fi *FileInfo, err error) + func (c *Client) Close() + func (c *Client) Create(path string) (f *File, err error) + func (c *Client) GetDirStats(path string) (ds *DirStats, err error) + func (c *Client) Mkdir(path string) (err error) + func (c *Client) Open(path string) (f *File, err error) + func (c *Client) OpenOrCreate(path string) (f *File, err error) + func (c *Client) ReadFile(path, localPath string) (err error) + func (c *Client) Readdir(path string) (infoMap ReaddirInfoMap, err error) + func (c *Client) Rmdir(path string) (err error) + func (c *Client) Unlink(path string) (err error) + func (c *Client) WriteFile(localPath, path string) (err error) + type DirStats struct + Chunks uint32 + Dirs uint32 + Files uint32 + Inode uint32 + Inodes uint32 + Length uint64 + RSize uint64 + Size uint64 + type File struct + Path string + func (f *File) Length() string + func (f *File) Read(buf []byte, offset uint64) (n uint32, err error) + func (f *File) Write(buf []byte, offset uint64) (n uint32, err error) + type FileInfo struct + ATime time.Time + CTime time.Time + Flags uint8 + Gid uint32 + Inode uint32 + MTime time.Time + Mode os.FileMode + NLink uint32 + Size uint64 + Type uint8 + Uid uint32 + func (fi *FileInfo) GetSize() string + func (fi *FileInfo) IsDir() bool + func (fi *FileInfo) IsFile() bool + func (fi *FileInfo) String() string + type MAClient struct + Password string + RootPath string + Subdir string + func NewMAClient(addr string) *MAClient + func NewMAClientPwd(addr, pwd string, heartbeat bool) (c *MAClient) + func NewTools(addr string) *MAClient + func (c *MAClient) Access(inode uint32, mode uint16) (err error) + func (c *MAClient) AllQuotaInfo() (quota QuotaInfoMap, err error) + func (c *MAClient) Chmod(inode uint32, mode uint16) (fi *FileInfo, err error) + func (c *MAClient) Chown(inode uint32, uid, gid uint32) (fi *FileInfo, err error) + func (c *MAClient) Close() + func (c *MAClient) CloseSession() (err error) + func (c *MAClient) Connect() (err error) + func (c *MAClient) Create(parent uint32, name string, mode uint16) (fi *FileInfo, err error) + func (c *MAClient) CreateSession() (err error) + func (c *MAClient) GetAttr(inode uint32) (fi *FileInfo, err error) + func (c *MAClient) GetDirStats(inode uint32) (ds *DirStats, err error) + func (c *MAClient) Link(inode, inodeDst uint32, nameDst string) (fi *FileInfo, err error) + func (c *MAClient) ListSession() (ids []uint32, err error) + func (c *MAClient) Lookup(parent uint32, name string) (fi *FileInfo, err error) + func (c *MAClient) MasterVersion() error + func (c *MAClient) Mkdir(parent uint32, name string, mode uint16) (fi *FileInfo, err error) + func (c *MAClient) Mknod(parent uint32, name string, mode uint16) (fi *FileInfo, err error) + func (c *MAClient) Open(inode uint32, flags uint8) (fi *FileInfo, err error) + func (c *MAClient) Purge(inode uint32) (err error) + func (c *MAClient) QuotaControl(info *QuotaInfo, mode QuotaMode) (err error) + func (c *MAClient) ReadChunk(inode, index uint32, flags uint8) (cs *CSData, err error) + func (c *MAClient) ReadLink(inode uint32) (path string, err error) + func (c *MAClient) Readdir(parent uint32) (infoMap ReaddirInfoMap, err error) + func (c *MAClient) ReaddirAttr(parent uint32) (infoMap ReaddirInfoAttrMap, err error) + func (c *MAClient) Recv(buf []byte) (n int, err error) + func (c *MAClient) RemoveSession(sessionId uint32) (err error) + func (c *MAClient) Rename(inodeSrc uint32, nameSrc string, inodeDst uint32, nameDst string) (fi *FileInfo, err error) + func (c *MAClient) Rmdir(parent uint32, name string) (err error) + func (c *MAClient) Send(msg []byte) error + func (c *MAClient) SetAttr(inode uint32, setmask uint8, mode uint16, uid, gid, atime, mtime uint32) (fi *FileInfo, err error) + func (c *MAClient) Statfs() (st *StatInfo, err error) + func (c *MAClient) Symlink(parent uint32, name string, path string) (fi *FileInfo, err error) + func (c *MAClient) Truncate(inode uint32, flags uint8) (fi *FileInfo, err error) + func (c *MAClient) UnPackQuota(buf []byte) *QuotaInfo + func (c *MAClient) Undel(inode uint32) (err error) + func (c *MAClient) Unlink(parent uint32, name string) (err error) + func (c *MAClient) WriteChunk(inode, index uint32, flags uint8) (cs *CSData, err error) + func (c *MAClient) WriteChunkEnd(chunkId uint64, inode, index uint32, length uint64, flags uint8) (err error) + type Mode int + const Binary + const Decimal + type QuotaInfo struct + func (info *QuotaInfo) Usage() (current, quota string, retio float64) + type QuotaInfoMap map[string]*QuotaInfo + func GetUsage(masterAddr string) (QuotaInfoMap, error) + type QuotaMode int + const QuotaDel + const QuotaGet + const QuotaSet + type ReaddirInfo struct + Inode uint32 + Name string + Type uint8 + type ReaddirInfoAttr struct + Info *FileInfo + Inode uint32 + Name string + type ReaddirInfoAttrMap map[uint32]*ReaddirInfoAttr + type ReaddirInfoMap map[uint32]*ReaddirInfo + type StatInfo struct + AvailSpace uint64 + Inodes uint32 + ReservedSpace uint64 + TotalSpace uint64 + TrashSpace uint64 + type Version uint32 + func GetVersion(ver uint32) Version + func ParseVersionInt(maj uint16, mid, min uint8) Version + func ParseVersionString(str string) Version + func (v Version) LessThan(maj uint16, mid, min uint8) bool + func (v Version) MoreThan(maj uint16, mid, min uint8) bool + func (v Version) String() string + func (v Version) ToInt() (maj uint16, mid, min uint8)