utilities

package
v0.0.0-...-6aa4138 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleCoverUpload

func HandleCoverUpload(uploadedFile *multipart.FileHeader, cover *types.Cover, database *sql.DB, uploadDirectory *string)

This takes a cover file and stores it in the file system and database.

This function does not return anything.

func HandleVideoUpload

func HandleVideoUpload(uploadedFile *multipart.FileHeader, video *types.Video, database *sql.DB, uploadDirectory *string)

This takes a video file and stores it in the file system and database.

This function does not return anything.

func InitializeDatabase

func InitializeDatabase(appDirectory *string) *sql.DB

Initializes the database by ensuring that the database file and needed tables are all present and ready to be used during the server's runtime. Returns the database as a pointer to an sql.DB struct.

func InitializeLogger

func InitializeLogger() (*os.File, string)

func InitializeServer

func InitializeServer() string

Initializes the server by ensuring that the needed directories are present during the server's runtime. returns the path of the running executable's directory.

func Minimum

func Minimum(num1 int, num2 int) int

Returns the minimum of two integers. Needed this for video streaming chunk calculations.

func PlaceholderCover

func PlaceholderCover() []byte

Returns the bytes of a placeholder cover that I got from placehold.co

Dimensions of the placeholder cover are 400x600 (pixels) and the file is formatted in jpg. User provided covers should follow these specifications.

func PlaceholderThumbnail

func PlaceholderThumbnail() []byte

Returns the bytes of a placeholder thumbnail that I got from placehold.co

Dimensions of the placeholder cover are 640x360 (pixels) and the file is formatted in jpg. User provided covers should follow these specifications.

func RenameLogFile

func RenameLogFile(file *os.File, oldPath string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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