path

package
v1.13.6 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base added in v1.5.11

func Base(path string) string

获取url的文件部分

func CleanDir added in v1.5.11

func CleanDir(path string) string

func Cleanse added in v1.5.11

func Cleanse(path string) string

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

func Dir added in v1.5.11

func Dir(path string) string

func DirCleanse added in v1.5.11

func DirCleanse(dir string) string

仅仅针对目录名,Removed unsupported characters

func FileCleanse added in v1.5.11

func FileCleanse(filename string) string

仅仅针对文件名,Removed unsupported characters

func FileNoExt added in v1.5.11

func FileNoExt(filepath string) string

获取文件名除去扩展名

func FileRewrite added in v1.5.11

func FileRewrite(filename string) string

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

func Split

func Split(path string) (dir, file string)

返回目录名和文件名

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:""`
	DateStr  string
	FileName string `json:"fileName"`
}

year/key_date_title/filename

func (*ById) Path added in v1.5.11

func (d *ById) Path() string

type ByIdUId added in v1.13.6

type ByIdUId struct {
	UserId    int       `json:"userId"`
	UserIdStr string    `json:"userIdStr"`
	Id        int       `json:"id"`
	IdStr     string    `json:"idStr"`
	FileName  string    `json:"fileName"`
	PubAt     time.Time `json:"pubAt" gorm:"type:timestamptz(0);default:0001-01-01 00:00:00"`
	PubAtStr  string    `json:"pubAtStr" comment:"20230321"`
}

userId/year/date_userId_key_filename

func (*ByIdUId) Path added in v1.13.6

func (d *ByIdUId) Path() string

func (*ByIdUId) PreHandle added in v1.13.6

func (d *ByIdUId) PreHandle()

type ByIdUIdTitle added in v1.13.6

type ByIdUIdTitle struct {
	ByIdUId
	Title string
}

userId/date_key_title/date_userId_key_filename

func (*ByIdUIdTitle) Path added in v1.13.6

func (d *ByIdUIdTitle) Path() string

type ByPath added in v1.5.11

type ByPath string

filename

func (ByPath) Path added in v1.5.11

func (d ByPath) Path() string

type Path added in v1.5.11

type Path interface {
	Path() string
}

Jump to

Keyboard shortcuts

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