-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
42 lines (35 loc) · 931 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package main
import (
"context"
"os"
"enssat.tv/autovodsaver/constants"
"enssat.tv/autovodsaver/storage"
"enssat.tv/autovodsaver/watchdog"
"github.com/rs/zerolog"
)
const (
accessKey = ""
secretKey = ""
)
func main() {
ctx := context.Background()
// Setup logger
logger := zerolog.New(nil).Output(zerolog.ConsoleWriter{Out: os.Stdout}).Level(zerolog.InfoLevel)
ctx = context.WithValue(ctx, constants.LoggerKey, &logger)
// Setup storage
store, newS3Error := storage.NewS3StorageWithContext(ctx, "http://:9000", "eu-west", "enssatv", storage.Credentials{
AccessKey: accessKey,
SecretKey: secretKey,
Session: "",
})
if newS3Error != nil {
logger.Error().Msg(newS3Error.Error())
os.Exit(1)
}
ctx = context.WithValue(ctx, constants.StorageKey, &store)
logger.Info().Msg("AutoVODSaver (by EnssaTV)")
wd := watchdog.NewWithContext(ctx, "sqlite", "mistermv")
wd.Run()
defer wd.Stop()
select {}
}