Documentation ¶
Index ¶
- func HandleCoverUpload(uploadedFile *multipart.FileHeader, cover *types.Cover, database *sql.DB, ...)
- func HandleVideoUpload(uploadedFile *multipart.FileHeader, video *types.Video, database *sql.DB, ...)
- func InitializeDatabase(appDirectory *string) *sql.DB
- func InitializeLogger() (*os.File, string)
- func InitializeServer() string
- func Minimum(num1 int, num2 int) int
- func PlaceholderCover() []byte
- func PlaceholderThumbnail() []byte
- func RenameLogFile(file *os.File, oldPath string)
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 ¶
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 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 ¶
Types ¶
This section is empty.