functions

package
v0.0.0-...-df17b5b Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildInsertQuery

func BuildInsertQuery(tableName string, object interface{}) (string, []any)

func BuildUpdateQuery

func BuildUpdateQuery(tableName string, object interface{}) (string, []any)

func DBCreate

func DBCreate(database *sql.DB, tableName string, infoStruct *interface{}) *error

func DBDeleteMultiple

func DBDeleteMultiple(database *sql.DB, tableName string) *error

func DBDeleteSingle

func DBDeleteSingle(database *sql.DB, tableName string, id string) *error

func DBReadMultiple

func DBReadMultiple(database *sql.DB, tableName string, columns []string, values []interface{}) *error

func DBReadSingle

func DBReadSingle(database *sql.DB, tableName string, column string, value interface{}) *error

func DBUpdate

func DBUpdate(database *sql.DB, tableName string, infoStruct *interface{}) *error

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 RenameLogFile

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

func SeriesCover

func SeriesCover(uploadedFile *multipart.FileHeader, seriesCover *types.SeriesCover, database *sql.DB, uploadDirectory *string) *responses.Error

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

This function returns an error response that needs to be sent to the client.

func SeriesEpisode

func SeriesEpisode(uploadedFile *multipart.FileHeader, episode *types.Episode, database *sql.DB, uploadDirectory *string) *responses.Error

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

This function does not return anything.

func UploadMovie

func UploadMovie(uploadedFile *multipart.FileHeader, movieStruct *types.Movie, database *sql.DB, uploadDirectory *string) (*string, *responses.Error)

func UploadMovieCover

func UploadMovieCover(uploadedFile *multipart.FileHeader, movieCover *types.MovieCover, database *sql.DB, uploadDirectory *string) *responses.Error

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

This function returns an error response that needs to be sent to the client.

Types

This section is empty.

Jump to

Keyboard shortcuts

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