Documentation ¶
Index ¶
- Constants
- Variables
- func CheckAndNewGSettings(schema string) (*gio.Settings, error)
- func CopyDir(src, dest string) error
- func CopyFile(src, dest string) (err error)
- func CreateFile(filename string) error
- func DecodeURI(uri string) (content string)
- func EncodeURI(content, scheme string) (uri string)
- func EnsureDirExist(path string) error
- func EnsureDirExistWithPerm(path string, perm os.FileMode) error
- func ExecAndWait(timeout int, name string, arg ...string) (stdout, stderr string, err error)
- func GenUuid() string
- func GenerateCacheFilePath(keyword string) (dstfile string)
- func GenerateCacheFilePathWithPrefix(prefix, keyword string) (dstfile string)
- func GetCacheDir() string
- func GetConfigDir() string
- func GetFilesInDir(dir string) ([]string, error)
- func GetHomeDir() string
- func GetURIContent(uri string) (content string)
- func GetURIScheme(uri string) (scheme string)
- func GetUserName() string
- func IsDir(path string) bool
- func IsElementEqual(e1, e2 interface{}) bool
- func IsElementInList(e interface{}, list interface{}) bool
- func IsEnvExists(envName string) (ok bool)
- func IsFileExist(path string) bool
- func IsGSchemaExist(schema string) bool
- func IsInterfaceNil(v interface{}) bool
- func IsSymlink(path string) bool
- func IsURI(s string) (ok bool)
- func MoveDir(src, dest string) error
- func MoveFile(src, dest string) error
- func NewKeyFileFromFile(file string) (*glib.KeyFile, error)
- func PathToURI(filepath, scheme string) string
- func RandString(n int) string
- func ReadKeyFromKeyFile(filename, group, key string, t interface{}) (interface{}, bool)
- func SumFileMd5(filename string) (string, bool)
- func SumStrMd5(str string) (string, bool)
- func SymlinkFile(src, dest string) error
- func URIToPath(uri string) string
- func UnsetEnv(envName string) (err error)
- func WriteKeyToKeyFile(filename, group, key string, value interface{}) bool
- func WriteStringToFile(filename, content string) error
- func WriteStringToKeyFile(filename, content string) bool
- type Config
- func (c *Config) GetConfigFile() string
- func (c *Config) GetFileContentToSave(v interface{}) (fileContent []byte, err error)
- func (c *Config) IsConfigFileExists() bool
- func (c *Config) Load(v interface{}) (err error)
- func (c *Config) Lock()
- func (c *Config) RemoveConfigFile() error
- func (c *Config) Save(v interface{}) (err error)
- func (c *Config) SetConfigFile(file string)
- func (c *Config) SetConfigName(name string)
- func (c *Config) SetSystemConfigName(name string)
- func (c *Config) Unlock()
- type FilesystemInfo
- type WatchProxy
Constants ¶
View Source
const ( SCHEME_FILE = "file://" SCHEME_FTP = "ftp://" SCHEME_HTTP = "http://" SCHEME_HTTPS = "https://" SCHEME_SMB = "smb://" )
Variables ¶
View Source
var ( DefaultHomeConfigPrefix = os.Getenv("HOME") + "/.config/deepin/" DefaultSystemConfigPrefix = "/var/cache/deepin/" DefaultConfigExt = ".json" )
View Source
var DefaultCachePrefix = os.Getenv("HOME") + "/.cache/deepin"
Functions ¶
func CheckAndNewGSettings ¶
func CreateFile ¶
func EnsureDirExist ¶
func ExecAndWait ¶
func GenerateCacheFilePath ¶
func GetCacheDir ¶
func GetCacheDir() string
func GetConfigDir ¶
func GetConfigDir() string
func GetFilesInDir ¶
func GetHomeDir ¶
func GetHomeDir() string
func GetURIContent ¶
func GetURIScheme ¶
func GetUserName ¶
func GetUserName() string
func IsElementEqual ¶
func IsElementEqual(e1, e2 interface{}) bool
func IsElementInList ¶
func IsElementInList(e interface{}, list interface{}) bool
func IsEnvExists ¶
func IsFileExist ¶
func IsGSchemaExist ¶
func IsInterfaceNil ¶
func IsInterfaceNil(v interface{}) bool
func NewKeyFileFromFile ¶
func RandString ¶
func ReadKeyFromKeyFile ¶
func SumFileMd5 ¶
func SymlinkFile ¶
func WriteKeyToKeyFile ¶
func WriteStringToFile ¶
func WriteStringToKeyFile ¶
TODO: Abandoned it Do't use this interface.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func (*Config) GetConfigFile ¶
func (*Config) GetFileContentToSave ¶
func (*Config) IsConfigFileExists ¶
func (*Config) RemoveConfigFile ¶
func (*Config) SetConfigFile ¶
func (*Config) SetConfigName ¶
func (*Config) SetSystemConfigName ¶
type FilesystemInfo ¶
type FilesystemInfo struct { TotalSize uint64 // byte FreeSize uint64 AvailSize uint64 UsedSize uint64 }
func QueryFilesytemInfo ¶
func QueryFilesytemInfo(path string) (*FilesystemInfo, error)
type WatchProxy ¶
type WatchProxy struct {
// contains filtered or unexported fields
}
func NewWatchProxy ¶
func NewWatchProxy() *WatchProxy
func (*WatchProxy) EndWatch ¶
func (w *WatchProxy) EndWatch()
func (*WatchProxy) ResetFileListWatch ¶
func (w *WatchProxy) ResetFileListWatch()
func (*WatchProxy) SetErrorHandler ¶
func (w *WatchProxy) SetErrorHandler(f func(error))
func (*WatchProxy) SetEventHandler ¶
func (w *WatchProxy) SetEventHandler(f func(*fsnotify.FileEvent))
func (*WatchProxy) SetFileList ¶
func (w *WatchProxy) SetFileList(fileList []string)
func (*WatchProxy) StartWatch ¶
func (w *WatchProxy) StartWatch()
Click to show internal directories.
Click to hide internal directories.