model

package
v1.12.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectToSQLite

func ConnectToSQLite() (*gorm.DB, error)

func EventLogAdd

func EventLogAdd(db *gorm.DB, c *fiber.Ctx, status, tag, msg string)

model.EventLogAdd(db, c, "500", "CORE", "Error "+err.Error()) model.EventLogAdd(nil, nil, "500", "CORE", "Error "+err.Error())

func FileAddAsync

func FileAddAsync(db *gorm.DB, FullPath string) error

func FileChkAsync

func FileChkAsync(db *gorm.DB)

func FileDelAsync

func FileDelAsync(db *gorm.DB, FullPath string)

func FileDelMd5Async added in v1.12.0

func FileDelMd5Async(db *gorm.DB, FullPath string)

remove hash_thumb file if exist physically

func GetExtNorm added in v1.12.0

func GetExtNorm(path string) string

get ext and normalize

func GetMd5File

func GetMd5File(path string) string

func PrettyByteSize

func PrettyByteSize(b int64) string

func StringClearColor added in v1.12.2

func StringClearColor(msg string) string

Types

type EventLog

type EventLog struct {
	Id uint `json:"id" gorm:"unique;primaryKey;autoIncrement"`

	Proc_id int
	DT      string

	IP    string
	Login string

	Code string

	TAG string
	MSG string
}

func (EventLog) TableName

func (EventLog) TableName() string

type File

type File struct {
	ID uint `json:"id" gorm:"unique;primaryKey;autoIncrement"`

	MD5 string `gorm:"index:indx_file_md5"`

	FullPath string `gorm:"index:indx_file_full_path"`
	Name     string
	EXT      string

	IsDir   int
	Size    int64
	ModTime string
}

func (File) TableName

func (File) TableName() string

type FileSearch

type FileSearch struct {
	IsDir    int
	FullPath string
	Name     string
	EXT      string

	Size      int64
	SizeHuman string

	ModTime string

	OnlyFold     string
	OnlyFoldHtml template.HTML

	NameHtml template.HTML
}

func FileSearchResult

func FileSearchResult(db *gorm.DB, arg_fold, s string) []FileSearch

type Tabler

type Tabler interface {
	TableName() string
}

Jump to

Keyboard shortcuts

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