path

package
v0.0.39 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const PathSeparator = string(os.PathSeparator)

Variables

This section is empty.

Functions

func Cleanse

func Cleanse(path string) string

针对带目录的完整文件名,Removed unsupported characters

func DirCleanse

func DirCleanse(dir string) string

仅仅针对目录名,Removed unsupported characters

func FileCleanse

func FileCleanse(filename string) string

仅仅针对文件名,Removed unsupported characters

func FileNoExt

func FileNoExt(filepath string) string

获取文件名除去扩展名

func FileRewrite

func FileRewrite(filename string) string

windows需要,由于linux的文件也要放到windows看,统一处理

Types

type ById

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

func (*ById) Path

func (d *ById) Path() string

type ByPath

type ByPath string

path

func (ByPath) Path

func (d ByPath) Path() string

type ByUId

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

func (*ByUId) Path

func (d *ByUId) Path() string

func (*ByUId) PreHandle

func (d *ByUId) PreHandle()

type ByUIdTitle

type ByUIdTitle struct {
	ByUId
	Title string
}

userId/date_key_title/time_userId_key_filename

func (*ByUIdTitle) Path

func (d *ByUIdTitle) Path() string

type Path

type Path interface {
	Path() string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL