Documentation ¶
Index ¶
- func BuildInsertQuery(tableName string, object interface{}) (string, []any)
- func BuildUpdateQuery(tableName string, object interface{}) (string, []any)
- func DBCreate(database *sql.DB, tableName string, infoStruct *interface{}) *error
- func DBDeleteMultiple(database *sql.DB, tableName string) *error
- func DBDeleteSingle(database *sql.DB, tableName string, id string) *error
- func DBReadMultiple(database *sql.DB, tableName string, columns []string, values []interface{}) *error
- func DBReadSingle(database *sql.DB, tableName string, column string, value interface{}) *error
- func DBUpdate(database *sql.DB, tableName string, infoStruct *interface{}) *error
- func InitializeDatabase(appDirectory *string) *sql.DB
- func InitializeLogger() (*os.File, string)
- func InitializeServer() string
- func Minimum(num1 int, num2 int) int
- func RenameLogFile(file *os.File, oldPath string)
- func SeriesCover(uploadedFile *multipart.FileHeader, seriesCover *types.SeriesCover, ...) *responses.Error
- func SeriesEpisode(uploadedFile *multipart.FileHeader, episode *types.Episode, database *sql.DB, ...) *responses.Error
- func UploadMovie(uploadedFile *multipart.FileHeader, movieStruct *types.Movie, database *sql.DB, ...) (*string, *responses.Error)
- func UploadMovieCover(uploadedFile *multipart.FileHeader, movieCover *types.MovieCover, ...) *responses.Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildInsertQuery ¶
func BuildUpdateQuery ¶
func DBReadMultiple ¶
func DBReadSingle ¶
func InitializeDatabase ¶
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 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 ¶
Returns the minimum of two integers. Needed this for video streaming chunk calculations.
func RenameLogFile ¶
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 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.