Documentation ¶
Index ¶
- Constants
- func CheckExist(src string) bool
- func CheckPermission(src string) bool
- func Dsn(m *Mysql) string
- func FileCreate(content bytes.Buffer, name string)
- func FileMonitoringById(ctx context.Context, filePth string, id string, group string, ...)
- func Get() []string
- func GetCurrentPath() string
- func GetDBType(link string) string
- func GetExt(fileName string) string
- func GetFileSize(filename string) int64
- func GetImgType(p string) (string, error)
- func GetLocalHost() string
- func GetLocation(ctx context.Context, ip string) string
- func GetSize(f multipart.File) (int, error)
- func GetType(p string) (string, error)
- func IsNotExistMkDir(src string) error
- func MkDir(src string) error
- func Open(name string, flag int, perm os.FileMode) (*os.File, error)
- func PathCreate(dir string) error
- func PathExist(addr string) bool
- func Round(f float64, n int) float64
- func SaveUploadedFile(file *multipart.FileHeader, dst string) error
- type LocationResp
- type Mysql
- type ReplaceHelper
Constants ¶
View Source
const (
UserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36"
)
Variables ¶
This section is empty.
Functions ¶
func FileCreate ¶
func FileMonitoringById ¶
func IsNotExistMkDir ¶ added in v0.4.1
IsNotExistMkDir 检查文件夹是否存在 如果不存在则新建文件夹
func PathCreate ¶
func SaveUploadedFile ¶
func SaveUploadedFile(file *multipart.FileHeader, dst string) error
SaveUploadedFile uploads the form file to specific dst.
Types ¶
type LocationResp ¶
type LocationResp struct { Status string `json:"status"` // success Country string `json:"country"` CountryCode string `json:"countryCode"` Region string `json:"region"` RegionName string `json:"regionName"` City string `json:"city"` Zip string `json:"zip"` Lat float64 `json:"lat"` Lon float64 `json:"lon"` Timezone string `json:"timezone"` Isp string `json:"isp"` Org string `json:"org"` As string `json:"as"` Query string `json:"query"` }
type Mysql ¶ added in v0.4.1
type Mysql struct { Path string `json:"path" yaml:"path"` Config string `json:"config" yaml:"config"` Dbname string `json:"dbname" yaml:"db-name"` Username string `json:"username" yaml:"username"` Password string `json:"password" yaml:"password"` MaxIdleConnes int `json:"maxIdleConnes" yaml:"max-idle-connes"` MaxOpenConnes int `json:"maxOpenConnes" yaml:"max-open-connes"` LogMode bool `json:"logMode" yaml:"log-mode"` LogZap string `json:"logZap" yaml:"log-zap"` }
type ReplaceHelper ¶
func (*ReplaceHelper) DoWork ¶
func (h *ReplaceHelper) DoWork() error
Directories ¶
Path | Synopsis |
---|---|
filelocker
Package filelocker provide an upload locker based on the local file system.
|
Package filelocker provide an upload locker based on the local file system. |
filestore
Package filestore provide a storage backend based on the local file system.
|
Package filestore provide a storage backend based on the local file system. |
memorylocker
Package memorylocker provides an in-memory locking mechanism.
|
Package memorylocker provides an in-memory locking mechanism. |
Click to show internal directories.
Click to hide internal directories.