Documentation ¶
Index ¶
- Constants
- func Base(path string) string
- func CleanDir(path string) string
- func Cleanse(path string) string
- func Dir(path string) string
- func DirCleanse(dir string) string
- func FileCleanse(filename string) string
- func FileNoExt(filepath string) string
- func FileRewrite(filename string) string
- func Split(path string) (dir, file string)
- type ById
- type ByPath
- type ByUId
- type ByUIdTitle
- type Path
Constants ¶
View Source
const PathSeparator = string(os.PathSeparator)
Variables ¶
This section is empty.
Functions ¶
func DirCleanse ¶ added in v1.5.11
仅仅针对目录名,Removed unsupported characters
func FileCleanse ¶ added in v1.5.11
仅仅针对文件名,Removed unsupported characters
func FileRewrite ¶ added in v1.5.11
windows需要,由于linux的文件也要放到windows看,统一处理
Types ¶
type ById ¶ added in v1.5.11
type ById struct { Id int `json:"id"` IdStr string `json:"idStr"` Title string //PrePath string `json:"prePath" comment:""` TimeStr string FileName string `json:"fileName"` }
year/key_date_title/filename
type ByUId ¶ added in v1.5.11
type ByUId struct { UserId int `json:"userId"` UserIdStr string `json:"userIdStr"` Id int `json:"id"` IdStr string `json:"idStr"` Time time.Time `json:"pubAt" gorm:"type:timestamptz(0);default:0001-01-01 00:00:00"` TimeStr string `json:"pubAtStr" comment:"20230321"` FileName string `json:"fileName"` }
userId/year/time_userId_key_filename
type ByUIdTitle ¶ added in v1.5.11
userId/date_key_title/time_userId_key_filename
func (*ByUIdTitle) Path ¶ added in v1.5.11
func (d *ByUIdTitle) Path() string
Click to show internal directories.
Click to hide internal directories.