core

package
v0.0.0-...-98926e9 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TableName = "videos"
)

Some Importent Const ;

View Source
const (
	ThumbnailDir = "thumbnails"
)

Thumbnail Dir Name ;

Variables

This section is empty.

Functions

func OpenViDB

func OpenViDB(path string) (*gorm.DB, error)

OpenViDB Database from given path ;

func SaveUploadedFile

func SaveUploadedFile(file io.Reader, pathAndName string) error

SaveUploadedFile : save the file to given path if not exsists ;

func ViDataHasColumName

func ViDataHasColumName(columName string) bool

ViDataHasColumName : to check if ViData Tabel Contain Colum Name ? ;

Types

type ViData

type ViData struct {
	ID       int    `gorm:"AUTOINCREMENT;PRIMARY_KEY" json:"id"`
	Filename string `gorm:"Type:TEXT;UNIQUE;NOT NULL" json:"filename"`
	Title    string `gorm:"Type:TEXT;NOT NULL" json:"title"`
	Subject  string `gorm:"Type:TEXT;NOT NULL" json:"subject"`
	Author   string `gorm:"Type:TEXT" json:"author"`
	Tags     string `gorm:"Type:TEXT" json:"tags"`
	Desc     string `gorm:"Type:TEXT" json:"desc"`
	Indx     int    `gorm:"NOT NULL" json:"indx"`
}

ViData : is a representaion of SQL video table's row ;

func Form2ViData

func Form2ViData(formData map[string][]string) (ViData, error)

Form2ViData : FormData to ViData with Validation.

func (ViData) Validate

func (vidata ViData) Validate(ignoreFileName bool) bool

Validate : ViData Model ;

Jump to

Keyboard shortcuts

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