-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
45 lines (37 loc) · 949 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
43
44
45
// Yandex Disk File Pusher
// Copyright (c) 2019 Vladimir "fat0troll" Hodakov
package main
import (
"fmt"
"source.hodakov.me/fat0troll/yapusher/domains/yandex/v1"
"source.hodakov.me/fat0troll/yapusher/internal/context"
"runtime/debug"
)
// In production builds these variables are set by goreleaser
var (
version = "master"
commit = "?"
date = ""
)
//nolint:gochecknoinits
func init() {
if info, available := debug.ReadBuildInfo(); available {
if date == "" && info.Main.Version != "(devel)" {
version = info.Main.Version
commit = fmt.Sprintf("(unknown, mod sum: %q)", info.Main.Sum)
date = "(unknown)"
}
}
}
func main() {
c := context.New()
c.Init()
c.Logger.Info().Str("version", version).Str("commit", commit).Str("build date", date).Msg("yapusher is starting")
c.InitConfig()
// Initializing domains
yandexv1.New(c)
// Parsing app flags
c.Flagger.Parse()
// Authorizing to Yandex
yandexv1.Process()
}