Documentation ¶
Index ¶
- Constants
- Variables
- func ApplicationName() string
- func CleanFileName(parent, name string) string
- func DoListDir(dirPth string, suffix string, f func(fileName string) error) error
- func DoListDirEx(dirPth string, suffix string, f func(fullpath string, fileName string) error) error
- func DoWalkDir(dirPth, suffix string, f func(fileName string, isdir bool) error) error
- func GetExternalIP() (string, error)
- func GetHostIP() (string, error)
- func GetInternalIP() (string, error)
- func GetInternalIPByDevName(dev string) ([]string, error)
- func GetLocalConnectIP(proto string, addr string) (string, error)
- func GetRequestIP(r *http.Request) string
- func GetUploadFileSize(upfile multipart.File) (int64, error)
- func Index(s, substr string, start int) int
- func Inet_aton(ipnr net.IP) int64
- func Inet_ntoa(ipnr int64) net.IP
- func IsPublicIP(IP net.IP) bool
- func ListDir(dirPth string, suffix string, ch chan<- string) error
- func MultiCopy(src io.Reader, writers ...io.Writer) (written int64, err error)
- func PathExists(filename string) bool
- func PathExists2(filename string) (bool, error)
- func ScanZip(archive, tmpDir string, sizeLimit uint64, scanCall func(filename string) error) error
- func ScanZipM(archive string, sizeLimit uint64, scanCall func(f *zip.File) error) error
- func TempFileName(dir, prefix string) (string, error)
- func Unzip(src, dest string) error
- func UnzipSafe(archive, target string, sizeLimit uint64) error
- func WalkDir(dirPth, suffix string, ch chan<- string) error
- func WildcardCmp(txt, pattern string) bool
- func ZipSize(zipR *zip.ReadCloser) uint64
- type Size
- type Stat
- type VersionInt
Constants ¶
View Source
const (
DEFAULT_UNZIP_LIMIT = 64 * 1024 * 1024 * 1024
)
Variables ¶
View Source
var (
ErrUserQuit = errors.New("quit by user")
)
Functions ¶
func ApplicationName ¶
func ApplicationName() string
ApplicationName: return `this program`'s basename, if run in windows, returned string auto removed ".exe"
func CleanFileName ¶
func DoListDirEx ¶
func DoListDirEx(dirPth string, suffix string, f func(fullpath string, fileName string) error) error
获取指定目录下的所有文件,不进入下一级目录搜索,可以匹配后缀过滤。
func GetInternalIPByDevName ¶
根据网卡设备名称返回内部IP
func GetLocalConnectIP ¶
在主机拥有多个IP地址时,返回能够连通对端网络的自身主机IP
func GetRequestIP ¶
返回HTTP请求IP,优先级(X-Real-IP>X-Forwarded-For>Proxy-Client-IP>WL-Proxy-Client-IP")
func GetUploadFileSize ¶
返回HTTP upload文件的大小
func IsPublicIP ¶
func PathExists ¶
func PathExists2 ¶
func TempFileName ¶
TempFileName: new a temp filename in `dir` with `prefix`
func WildcardCmp ¶
wirdcard match, see https://en.wikipedia.org/wiki/Wild_card
func ZipSize ¶
func ZipSize(zipR *zip.ReadCloser) uint64
Types ¶
type VersionInt ¶
func NewVersionInt ¶
func NewVersionInt(verstr string, sepStr string) VersionInt
func (*VersionInt) Compatible ¶
func (v *VersionInt) Compatible(nv *VersionInt) bool
func (*VersionInt) Equal ¶
func (v *VersionInt) Equal(nv *VersionInt) bool
func (*VersionInt) GreatThan ¶
func (v *VersionInt) GreatThan(nv *VersionInt) bool
func (*VersionInt) LessThan ¶
func (v *VersionInt) LessThan(nv *VersionInt) bool
Click to show internal directories.
Click to hide internal directories.