Documentation
¶
Overview ¶
* Copyright (c) 2025 dingodb.com Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- Constants
- Variables
- func AbsPath(path string) string
- func AddBoolFlag(cmd *cobra.Command, name string, usage string)
- func AddConfigFileFlag(cmd *cobra.Command)
- func AddDurationFlag(cmd *cobra.Command, name string, usage string)
- func AddExecutePermission(filepath string) error
- func AddFormatFlag(cmd *cobra.Command)
- func AddInt32Flag(cmd *cobra.Command, name string, usage string)
- func AddStringFlag(cmd *cobra.Command, name string, usage string)
- func AddStringRequiredFlag(cmd *cobra.Command, name string, usage string)
- func AddUint32Flag(cmd *cobra.Command, name string, usage string)
- func AddUint32RequiredFlag(cmd *cobra.Command, name string, usage string)
- func AddUint64Flag(cmd *cobra.Command, name string, usage string)
- func All2Str(v interface{}) (value string, ok bool)
- func AskConfirmation(promptStr string, confirm string) bool
- func Atoa(v interface{}) string
- func CalcString2Signature(in string, secretKet string) string
- func CheckMountPoint(mountPoint string) error
- func CheckPathIsExported(shell *module.Shell, options module.ExecOptions, exportPath string, ...) bool
- func CheckQuota(capacity int64, usedBytes int64, maxInodes int64, usedInodes int64, ...) ([]string, bool)
- func Choose(ok bool, first, second string) string
- func Contains(list []string, str string) bool
- func ContainsList(list []string, strs []string) bool
- func ConvertFsExtraToString(fsExtra *mds.FsExtra) string
- func ConvertPbPartitionTypeToString(partitionType mds.PartitionType) string
- func ConvertQuotaToHumanizeValue(capacity uint64, usedBytes int64, maxInodes uint64, usedInodes int64) []string
- func DeepCopy(src map[string]interface{}) map[string]interface{}
- func Diff(s1 string, s2 string) string
- func DownloadFileWithProgress(url, destination, filename string) (string, error)
- func EncryptFile(srcfile, dstfile, secret string) error
- func ExecShell(format string, a ...interface{}) (string, error)
- func Existed(list []string, strs []string) bool
- func Filter(list []string, filterFunc func(string) bool) []string
- func GenerateFileName(inodeId uint64, exportPath string) string
- func GenetateExportId(shell *module.Shell, options module.ExecOptions, storePath string) (int, error)
- func GetBoolFlag(cmd *cobra.Command, flagName string) bool
- func GetConfigFile(cmd *cobra.Command) string
- func GetCurrentHomeDir() string
- func GetCurrentUser() string
- func GetDingoFSMountPoints() ([]*mountinfo.MountInfo, error)
- func GetDurationFlag(cmd *cobra.Command, flagName string) time.Duration
- func GetFileInode(path string) (uint64, error)
- func GetFilePermissions(path string) int
- func GetFsInfoFlagValue(cmd *cobra.Command) (uint32, string, error)
- func GetGaneshaPID(shell *module.Shell, options module.ExecOptions) (int, error)
- func GetInodeId(shell *module.Shell, options module.ExecOptions, path string) (uint64, error)
- func GetInodesAsString(listFilePath string) (string, error)
- func GetInt32Flag(cmd *cobra.Command, flagName string) int32
- func GetMDSAddrSlice(cmd *cobra.Command) ([]string, error)
- func GetQuotaValue(cmd *cobra.Command) (int64, int64, error)
- func GetString2Signature(date uint64, owner string) string
- func GetStringFlag(cmd *cobra.Command, flagName string) string
- func GetStringSliceFlag(cmd *cobra.Command, flagName string) []string
- func GetUint32Flag(cmd *cobra.Command, flagName string) uint32
- func GetUint64Flag(cmd *cobra.Command, flagName string) uint64
- func HasExecutePermission(filepath string) bool
- func IsAlpha(r rune) bool
- func IsBool(v interface{}) bool
- func IsDigit(r rune) bool
- func IsFileExists(filepath string) bool
- func IsFunc(v interface{}) bool
- func IsHTTPS(endpoint string) bool
- func IsInt(v interface{}) bool
- func IsInt64(v interface{}) bool
- func IsSSL(host string, timeout time.Duration) bool
- func IsString(v interface{}) bool
- func IsStringAnyMap(v interface{}) bool
- func IsTrueStr(s string) bool
- func IsUpper(r rune) bool
- func IsValidAddress(address string) bool
- func IsValidFsname(fsName string) bool
- func IsValidPath(path string) bool
- func Locate(s []string) map[string]int
- func MD5Sum(data string) string
- func Min(nums ...int) int
- func NewCommand(format string, a ...interface{}) *exec.Cmd
- func NotifyGaneshaReLoadConfig(shell *module.Shell, options module.ExecOptions, pid int) error
- func Path2DingofsPath(path string, mountpoint *mountinfo.MountInfo) string
- func PathExist(path string) bool
- func RandFilename(dir string) string
- func RandString(n int) string
- func ReadCommandConfig(cmd *cobra.Command)
- func ReadFile(filename string) (string, error)
- func RemoveDuplicates(strs []string) []string
- func RemoveHTTPPrefix(endpoint string) string
- func RmWitespaceStr(str string) string
- func SetErr(cmd *cobra.Command, writer io.Writer)
- func SetFlagErrorFunc(cmd *cobra.Command)
- func SetHelpTemplate(cmd *cobra.Command)
- func SetUsageTemplate(cmd *cobra.Command)
- func Slice2Map(s []string) map[string]bool
- func Str2Bool(s string) (bool, bool)
- func Str2Int(s string) (int, bool)
- func StringList2Uint32List(strList []string) ([]uint32, error)
- func StringList2Uint64List(strList []string) ([]uint64, error)
- func ToUnderscoredName(src string) string
- func TranslateCacheGroupMemberState(state mds.CacheGroupMemberState) string
- func TrimSuffixRepeat(s, suffix string) string
- func Type(v interface{}) string
- func WriteFile(filename, data string, mode int) error
- type PromptError
- type SafeMap
- type VariantName
Constants ¶
const ( FORMAT_JSON = "json" FORMAT_PLAIN = "plain" FORMAT_NOOUT = "noout" )
format
const ( RPCTIMEOUT = "rpctimeout" VIPER_GLOBALE_RPCTIMEOUT = "global.rpctimeout" DEFAULT_RPCTIMEOUT = 30000 * time.Millisecond RPCRETRYTIMES = "rpcretrytimes" VIPER_GLOBALE_RPCRETRYTIMES = "global.rpcretrytimes" DEFAULT_RPCRETRYTIMES = uint32(5) RPCRETRYDElAY = "rpcretrydelay" VIPER_GLOBALE_RPCRETRYDELAY = "global.rpcretrydelay" DEFAULT_RPCRETRYDELAY = 200 * time.Millisecond VERBOSE = "verbose" VIPER_GLOBALE_VERBOSE = "global.verbose" DEFAULT_VERBOSE = false FORMAT = "format" // dingofs DINGOFS_MDSADDR = "mdsaddr" VIPER_DINGOFS_MDSADDR = "dingofs.mdsaddr" DEFAULT_DINGOFS_MDSADDR = "127.0.0.1:7400" DINGOFS_FSID = "fsid" VIPER_DINGOFS_FSID = "dingofs.fsid" DEFAULT_DINGOFS_FSID = uint32(0) DINGOFS_FSNAME = "fsname" VIPER_DINGOFS_FSNAME = "dingofs.fsname" DINGOFS_MOUNTPOINT = "mountpoint" VIPER_DINGOFS_MOUNTPOINT = "dingofs.mountpoint" DINGOFS_PARTITIONID = "partitionid" VIPER_DINGOFS_PARTITIONID = "dingofs.partitionid" DINGOFS_NOCONFIRM = "noconfirm" VIPER_DINGOFS_NOCONFIRM = "dingofs.noconfirm" DINGOFS_USER = "user" VIPER_DINGOFS_USER = "dingofs.user" DINGOFS_CAPACITY = "capacity" VIPER_DINGOFS_CAPACITY = "dingofs.capacity" DINGOFS_DEFAULT_CAPACITY = "100 GiB" DINGOFS_BLOCKSIZE = "blocksize" VIPER_DINGOFS_BLOCKSIZE = "dingofs.blocksize" DINGOFS_DEFAULT_BLOCKSIZE = "4 MiB" DINGOFS_CHUNKSIZE = "chunksize" VIPER_DINGOFS_CHUNKSIZE = "dingofs.chunksize" DINGOFS_DEFAULT_CHUNKSIZE = "64 MiB" DINGOFS_STORAGETYPE = "storagetype" VIPER_DINGOFS_STORAGETYPE = "dingofs.storagetype" DINGOFS_DEFAULT_STORAGETYPE = "s3" DINGOFS_DETAIL = "detail" VIPER_DINGOFS_DETAIL = "dingofs.detail" DINGOFS_DEFAULT_DETAIL = false DINGOFS_INODEID = "inodeid" VIPER_DINGOFS_INODEID = "dingofs.inodeid" DINGOFS_DEFAULT_INODEID = uint64(0) // mds numbers DINGOFS_MDS_NUM = "mdsnum" VIPER_DINGOFS_MDS_NUM = "dingofs.mdsnum" DINGOFS_DEFAULT_MDS_NUM = uint32(0) DINGOFS_THREADS = "threads" VIPER_DINGOFS_THREADS = "dingofs.threads" DINGOFS_DEFAULT_THREADS = uint32(8) DINGOFS_FILELIST = "filelist" VIPER_DINGOFS_FILELIST = "dingofs.filelist" DINGOFS_DAEMON = "daemon" VIPER_DINGOFS_DAEMON = "dingofs.daemon" DINGOFS_DEFAULT_DAEMON = false DINGOFS_STORAGE = "storage" VIPER_DINGOFS_STORAGE = "dingofs.storage" DINGOFS_DEFAULT_STORAGE = "disk" DINGOFS_QUOTA_PATH = "path" VIPER_DINGOFS_QUOTA_PATH = "dingofs.quota.path" DINGOFS_QUOTA_DEFAULT_PATH = "" DINGOFS_QUOTA_CAPACITY = "capacity" DINGOFS_QUOTA_INODES = "inodes" DINGOFS_QUOTA_REPAIR = "repair" DINGOFS_QUOTA_DEFAULT_REPAIR = false DINGOFS_CLIENT_ID = "clientid" DINGOFS_PARTITION_TYPE = "partitiontype" VIPER_DINGOFS_PARTITION_TYPE = "dingofs.partitiontype" DINGOFS_DEFAULT_PARTITION_TYPE = "hash" DINGOFS_HUMANIZE = "humanize" VIPER_DINGOFS_HUMANIZE = "dingofs.humanize" DINGOFS_DEFAULT_HUMANIZE = false // S3 DINGOFS_S3_AK = "s3.ak" VIPER_DINGOFS_S3_AK = "dingofs.s3.ak" DINGOFS_DEFAULT_S3_AK = "" DINGOFS_S3_SK = "s3.sk" VIPER_DINGOFS_S3_SK = "dingofs.s3.sk" DINGOFS_DEFAULT_S3_SK = "" DINGOFS_S3_ENDPOINT = "s3.endpoint" VIPER_DINGOFS_S3_ENDPOINT = "dingofs.s3.endpoint" DINGOFS_DEFAULT_ENDPOINT = "" DINGOFS_S3_BUCKETNAME = "s3.bucketname" VIPER_DINGOFS_S3_BUCKETNAME = "dingofs.s3.bucketname" DINGOFS_DEFAULT_S3_BUCKETNAME = "" // rados DINGOFS_RADOS_USERNAME = "rados.username" VIPER_DINGOFS_RADOS_USERNAME = "dingofs.rados.username" DINGOFS_DEFAULT_RADOS_USERNAME = "" DINGOFS_RADOS_KEY = "rados.key" VIPER_DINGOFS_RADOS_KEY = "dingofs.rados.key" DINGOFS_DEFAULT_RADOS_KEY = "" DINGOFS_RADOS_MON = "rados.mon" VIPER_DINGOFS_RADOS_MON = "dingofs.rados.mon" DINGOFS_DEFAULT_RADOS_MON = "" DINGOFS_RADOS_POOLNAME = "rados.poolname" VIPER_DINGOFS_RADOS_POOLNAME = "dingofs.rados.poolname" DINGOFS_DEFAULT_RADOS_POOLNAME = "" DINGOFS_RADOS_CLUSTERNAME = "rados.clustername" VIPER_DINGOFS_RADOS_CLUSTERNAME = "dingofs.rados.clustername" DINGOFS_DEFAULT_RADOS_CLUSTERNAME = "ceph" // subpath uid,gid DINGOFS_SUBPATH_UID = "uid" VIPER_DINGOFS_SUBPATH_UID = "dingofs.subpath.uid" DINGOFS_DEFAULT_SUBPATH_UID = uint32(0) DINGOFS_SUBPATH_GID = "gid" VIPER_DINGOFS_SUBPATH_GID = "dingofs.subpath.gid" DINGOFS_DEFAULT_SUBPATH_GID = uint32(0) // cache group DINGOFS_CACHE_GROUP = "group" VIPER_DINGOFS_CACHE_GROUP = "dingofs.cachegroup.group" DINGOFS_DEFAULT_CACHE_GROUP = "" DINGOFS_CACHE_MEMBERID = "memberid" VIPER_DINGOFS_CACHE_MEMBERID = "dingofs.cachegroup.memberid" DINGOFS_DEFAULT_CACHE_MEMBERID = "" DINGOFS_CACHE_WEIGHT = "weight" VIPER_DINGOFS_CACHE_WEIGHT = "dingofs.cachegroup.weight" DINGOFS_DEFAULT_CACHE_WEIGHT = uint32(0) DINGOFS_CACHE_IP = "ip" VIPER_DINGOFS_CACHE_IP = "dingofs.cachegroup.ip" DINGOFS_DEFAULT_CACHE_IP = "" DINGOFS_CACHE_PORT = "port" VIPER_DINGOFS_CACHE_PORT = "dingofs.cachegroup.port" DINGOFS_DEFAULT_CACHE_PORT = uint32(0) // nfs-ganesha DINGOFS_NFS_PATH = "nfs.path" VIPER_DINGOFS_NFS_PATH = "dingofs.nfs.path" DINGOFS_DEFAULT_NFS_PATH = "" DINGOFS_NFS_CONF = "nfs.conf" VIPER_DINGOFS_NFS_CONF = "dingofs.nfs.conf" DINGOFS_DEFAULT_NFS_CONF = "" // ssh DINGOFS_SSH_HOST = "ssh.host" VIPER_DINGOFS_SSH_HOST = "dingofs.ssh.host" DINGOFS_DEFAULT_SSH_HOST = "" DINGOFS_SSH_PORT = "ssh.port" VIPER_DINGOFS_SSH_PORT = "dingofs.ssh.port" DINGOFS_DEFAULT_SSH_PORT = uint32(22) DINGOFS_SSH_USER = "ssh.user" VIPER_DINGOFS_SSH_USER = "dingofs.ssh.user" DINGOFS_DEFAULT_SSH_USER = "current user" DINGOFS_SSH_KEY = "ssh.key" VIPER_DINGOFS_SSH_KEY = "dingofs.ssh.key" DINGOFS_DEFAULT_SSH_KEY = "~/.ssh/id_rsa" )
const ( DINGOFS_MOUNTPOINT_FSTYPE = "fuse.dingofs" DINGOFS_MOUNTPOINT_FSTYPE2 = "fuse" //for backward compatibility )
const ( NFS_GANESHA_NAME = "ganesha.nfsd" NFS_EXPORT_STORE_PATH = "/etc/ganesha/export.d" )
const ( PATH_REGEX = `^(/[^/ ]*)+/?$` FS_NAME_REGEX = "^([a-z0-9]+\\-?)+$" K_STRING_TRUE = "true" ROOT_PATH = "/" RECYCLEBIN_PATH = "/RecycleBin" )
const (
IP_PORT_REGEX = "" /* 424-byte string literal not displayed */
)
const (
PREFIX_COBRA_COMMAND_ERROR = "Error:\n"
)
const (
REGEX_IP = `^(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.|$)){4})`
)
Variables ¶
var ( NoArgs = cli.NoArgs RequiresMinArgs = cli.RequiresMinArgs RequiresMaxArgs = cli.RequiresMaxArgs RequiresRangeArgs = cli.RequiresRangeArgs ExactArgs = cli.ExactArgs ShowHelp = command.ShowHelp )
var ( FLAG2VIPER = map[string]string{ RPCTIMEOUT: VIPER_GLOBALE_RPCTIMEOUT, RPCRETRYTIMES: VIPER_GLOBALE_RPCRETRYTIMES, RPCRETRYDElAY: VIPER_GLOBALE_RPCRETRYDELAY, VERBOSE: VIPER_GLOBALE_VERBOSE, DINGOFS_MDSADDR: VIPER_DINGOFS_MDSADDR, DINGOFS_FSID: VIPER_DINGOFS_FSID, DINGOFS_FSNAME: VIPER_DINGOFS_FSNAME, DINGOFS_MOUNTPOINT: VIPER_DINGOFS_MOUNTPOINT, DINGOFS_PARTITIONID: VIPER_DINGOFS_PARTITIONID, DINGOFS_NOCONFIRM: VIPER_DINGOFS_NOCONFIRM, DINGOFS_USER: VIPER_DINGOFS_USER, DINGOFS_CAPACITY: VIPER_DINGOFS_CAPACITY, DINGOFS_BLOCKSIZE: VIPER_DINGOFS_BLOCKSIZE, DINGOFS_CHUNKSIZE: VIPER_DINGOFS_CHUNKSIZE, DINGOFS_STORAGETYPE: VIPER_DINGOFS_STORAGETYPE, DINGOFS_DETAIL: VIPER_DINGOFS_DETAIL, DINGOFS_INODEID: VIPER_DINGOFS_INODEID, DINGOFS_THREADS: VIPER_DINGOFS_THREADS, DINGOFS_FILELIST: VIPER_DINGOFS_FILELIST, DINGOFS_DAEMON: VIPER_DINGOFS_DAEMON, DINGOFS_STORAGE: VIPER_DINGOFS_STORAGE, DINGOFS_QUOTA_PATH: VIPER_DINGOFS_QUOTA_PATH, DINGOFS_PARTITION_TYPE: VIPER_DINGOFS_PARTITION_TYPE, DINGOFS_HUMANIZE: VIPER_DINGOFS_HUMANIZE, DINGOFS_S3_AK: VIPER_DINGOFS_S3_AK, DINGOFS_S3_SK: VIPER_DINGOFS_S3_SK, DINGOFS_S3_ENDPOINT: VIPER_DINGOFS_S3_ENDPOINT, DINGOFS_S3_BUCKETNAME: VIPER_DINGOFS_S3_BUCKETNAME, DINGOFS_RADOS_USERNAME: VIPER_DINGOFS_RADOS_USERNAME, DINGOFS_RADOS_KEY: VIPER_DINGOFS_RADOS_KEY, DINGOFS_RADOS_MON: VIPER_DINGOFS_RADOS_MON, DINGOFS_RADOS_POOLNAME: VIPER_DINGOFS_RADOS_POOLNAME, DINGOFS_RADOS_CLUSTERNAME: VIPER_DINGOFS_RADOS_CLUSTERNAME, DINGOFS_SUBPATH_UID: VIPER_DINGOFS_SUBPATH_UID, DINGOFS_SUBPATH_GID: VIPER_DINGOFS_SUBPATH_GID, DINGOFS_CACHE_GROUP: VIPER_DINGOFS_CACHE_GROUP, DINGOFS_CACHE_MEMBERID: VIPER_DINGOFS_CACHE_MEMBERID, DINGOFS_CACHE_WEIGHT: VIPER_DINGOFS_CACHE_WEIGHT, DINGOFS_CACHE_IP: VIPER_DINGOFS_CACHE_IP, DINGOFS_CACHE_PORT: VIPER_DINGOFS_CACHE_PORT, DINGOFS_MDS_NUM: VIPER_DINGOFS_MDS_NUM, DINGOFS_NFS_PATH: VIPER_DINGOFS_NFS_PATH, DINGOFS_NFS_CONF: VIPER_DINGOFS_NFS_CONF, DINGOFS_SSH_HOST: VIPER_DINGOFS_SSH_HOST, DINGOFS_SSH_PORT: VIPER_DINGOFS_SSH_PORT, DINGOFS_SSH_USER: VIPER_DINGOFS_SSH_USER, DINGOFS_SSH_KEY: VIPER_DINGOFS_SSH_KEY, } FLAG2DEFAULT = map[string]interface{}{ RPCTIMEOUT: DEFAULT_RPCTIMEOUT, RPCRETRYTIMES: DEFAULT_RPCRETRYTIMES, RPCRETRYDElAY: DEFAULT_RPCRETRYDELAY, VERBOSE: DEFAULT_VERBOSE, DINGOFS_FSID: DEFAULT_DINGOFS_FSID, DINGOFS_MDSADDR: DEFAULT_DINGOFS_MDSADDR, DINGOFS_DETAIL: DINGOFS_DEFAULT_DETAIL, DINGOFS_THREADS: DINGOFS_DEFAULT_THREADS, DINGOFS_DAEMON: DINGOFS_DEFAULT_DAEMON, DINGOFS_BLOCKSIZE: DINGOFS_DEFAULT_BLOCKSIZE, DINGOFS_CHUNKSIZE: DINGOFS_DEFAULT_CHUNKSIZE, DINGOFS_STORAGE: DINGOFS_DEFAULT_STORAGE, DINGOFS_QUOTA_PATH: DINGOFS_QUOTA_DEFAULT_PATH, DINGOFS_QUOTA_REPAIR: DINGOFS_QUOTA_DEFAULT_REPAIR, DINGOFS_PARTITION_TYPE: DINGOFS_DEFAULT_PARTITION_TYPE, DINGOFS_HUMANIZE: DINGOFS_DEFAULT_HUMANIZE, DINGOFS_S3_AK: DINGOFS_DEFAULT_S3_AK, DINGOFS_S3_SK: DINGOFS_DEFAULT_S3_SK, DINGOFS_S3_ENDPOINT: DINGOFS_DEFAULT_ENDPOINT, DINGOFS_S3_BUCKETNAME: DINGOFS_DEFAULT_S3_BUCKETNAME, DINGOFS_RADOS_USERNAME: DINGOFS_DEFAULT_RADOS_USERNAME, DINGOFS_RADOS_KEY: DINGOFS_DEFAULT_RADOS_KEY, DINGOFS_RADOS_MON: DINGOFS_DEFAULT_RADOS_MON, DINGOFS_RADOS_POOLNAME: DINGOFS_DEFAULT_RADOS_POOLNAME, DINGOFS_RADOS_CLUSTERNAME: DINGOFS_DEFAULT_RADOS_CLUSTERNAME, DINGOFS_SUBPATH_UID: DINGOFS_DEFAULT_SUBPATH_UID, DINGOFS_SUBPATH_GID: DINGOFS_DEFAULT_SUBPATH_GID, DINGOFS_CACHE_GROUP: DINGOFS_DEFAULT_CACHE_GROUP, DINGOFS_CACHE_MEMBERID: DINGOFS_DEFAULT_CACHE_MEMBERID, DINGOFS_CACHE_WEIGHT: DINGOFS_DEFAULT_CACHE_WEIGHT, DINGOFS_CACHE_IP: DINGOFS_DEFAULT_CACHE_IP, DINGOFS_CACHE_PORT: DINGOFS_DEFAULT_CACHE_PORT, DINGOFS_MDS_NUM: DINGOFS_DEFAULT_MDS_NUM, DINGOFS_NFS_PATH: DINGOFS_DEFAULT_NFS_PATH, DINGOFS_NFS_CONF: DINGOFS_DEFAULT_NFS_CONF, DINGOFS_SSH_HOST: DINGOFS_DEFAULT_SSH_HOST, DINGOFS_SSH_PORT: DINGOFS_DEFAULT_SSH_PORT, DINGOFS_SSH_USER: DINGOFS_DEFAULT_SSH_USER, DINGOFS_SSH_KEY: DINGOFS_DEFAULT_SSH_KEY, } )
Functions ¶
func AddConfigFileFlag ¶
func AddExecutePermission ¶
func AddFormatFlag ¶
func AddStringRequiredFlag ¶
func AddUint32RequiredFlag ¶
func AskConfirmation ¶
func CalcString2Signature ¶
func CheckMountPoint ¶
func CheckPathIsExported ¶
func CheckPathIsExported(shell *module.Shell, options module.ExecOptions, exportPath string, storePath string) bool
check export path is already exported
func CheckQuota ¶
func CheckQuota(capacity int64, usedBytes int64, maxInodes int64, usedInodes int64, realUsedBytes int64, realUsedInodes int64) ([]string, bool)
check quota is consistent
func ContainsList ¶
func ConvertFsExtraToString ¶
func ConvertPbPartitionTypeToString ¶
func ConvertPbPartitionTypeToString(partitionType mds.PartitionType) string
func ConvertQuotaToHumanizeValue ¶
func ConvertQuotaToHumanizeValue(capacity uint64, usedBytes int64, maxInodes uint64, usedInodes int64) []string
convert number value to Humanize Value
func EncryptFile ¶
func GenerateFileName ¶
generate config file name /etc/ganesha/export.d/<inode-id>-<pathname>.conf,e.g.: 536932699-nfs01.conf
func GenetateExportId ¶
func GenetateExportId(shell *module.Shell, options module.ExecOptions, storePath string) (int, error)
each EXPORT must have a unique Export_Id
func GetConfigFile ¶
func GetCurrentHomeDir ¶
func GetCurrentHomeDir() string
func GetCurrentUser ¶
func GetCurrentUser() string
func GetDingoFSMountPoints ¶
func GetFilePermissions ¶
func GetFsInfoFlagValue ¶
check fsid and fsname
func GetGaneshaPID ¶
func GetInodeId ¶
func GetInodesAsString ¶
func GetQuotaValue ¶
check the quota value from command line
func GetString2Signature ¶
func HasExecutePermission ¶
func IsFileExists ¶
func IsStringAnyMap ¶
func IsStringAnyMap(v interface{}) bool
func IsValidAddress ¶
func IsValidFsname ¶
func IsValidPath ¶
func NewCommand ¶
func Path2DingofsPath ¶
make sure path' abs path start with mountpoint.MountPoint
func RandFilename ¶
func RandString ¶
func ReadCommandConfig ¶
func RemoveDuplicates ¶
func RemoveHTTPPrefix ¶
func SetFlagErrorFunc ¶
func SetHelpTemplate ¶
func SetUsageTemplate ¶
func StringList2Uint32List ¶
func StringList2Uint64List ¶
func ToUnderscoredName ¶
func TranslateCacheGroupMemberState ¶
func TranslateCacheGroupMemberState(state mds.CacheGroupMemberState) string
func TrimSuffixRepeat ¶
Types ¶
type PromptError ¶
func (PromptError) Error ¶
func (e PromptError) Error() string
type SafeMap ¶
type SafeMap struct {
sync.RWMutex
Map map[string]interface{}
// contains filtered or unexported fields
}
func NewSafeMap ¶
func NewSafeMap() *SafeMap
type VariantName ¶
type VariantName struct {
Name string
CompressName string
LocalCompressName string
EncryptCompressName string
}
func NewVariantName ¶
func NewVariantName(name string) VariantName