Add support for storing chunks on S3

This commit is contained in:
Gabe Kangas
2020-06-03 01:34:05 -07:00
parent 16047d884d
commit 8cd8c7df20
9 changed files with 167 additions and 306 deletions

11
main.go
View File

@@ -15,17 +15,24 @@ var server *Server
var online = false
func main() {
checkConfig(configuration)
// resetDirectories()
var hlsDirectoryPath = configuration.PublicHLSPath
log.Println("Starting up. Please wait...")
var usingExternalStorage = false
if configuration.IPFS.Enabled {
storage = &IPFSStorage{}
(storage).Setup(configuration)
usingExternalStorage = true
} else if configuration.S3.Enabled {
storage = &S3Storage{}
usingExternalStorage = true
}
if usingExternalStorage {
storage.Setup(configuration)
hlsDirectoryPath = configuration.PrivateHLSPath
go monitorVideoContent(hlsDirectoryPath, configuration, storage)
}