refactor and add videos
This commit is contained in:
parent
4568ea3913
commit
2c44abde3c
10 changed files with 2818 additions and 173 deletions
30
internal/config/config.go
Normal file
30
internal/config/config.go
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Workers int
|
||||
TgAPIKey string
|
||||
TgChatID int64
|
||||
VkAPIKey string
|
||||
}
|
||||
|
||||
// MustLoad loads the config.
|
||||
func MustLoad() *Config {
|
||||
var Conf Config
|
||||
var err error
|
||||
Conf.Workers, err = strconv.Atoi(os.Getenv("Workers"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
Conf.TgAPIKey = os.Getenv("TgAPIKey")
|
||||
Conf.VkAPIKey = os.Getenv("VkAPIKey")
|
||||
Conf.TgChatID, err = strconv.ParseInt(os.Getenv("TgChatID"), 10, 64)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return &Conf
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue