@@ -11,6 +11,8 @@ import (
|
|||||||
type Config struct {
|
type Config struct {
|
||||||
Url string `json:"url" mapstructure:"url"`
|
Url string `json:"url" mapstructure:"url"`
|
||||||
Token string `json:"token" mapstructure:"token"`
|
Token string `json:"token" mapstructure:"token"`
|
||||||
|
HasVideoToken string `json:"has_video_token" mapstructure:"has-video-token"`
|
||||||
|
NoVideoToken string `json:"no_video_token" mapstructure:"no-video-token"`
|
||||||
ThreadCount int `json:"thread_count" mapstructure:"thread-count"`
|
ThreadCount int `json:"thread_count" mapstructure:"thread-count"`
|
||||||
HandleFileCount int `json:"handle_file_count" mapstructure:"handle-file-count"`
|
HandleFileCount int `json:"handle_file_count" mapstructure:"handle-file-count"`
|
||||||
IsRunOnStart bool `json:"is_run_on_start" mapstructure:"is-run-on-start"`
|
IsRunOnStart bool `json:"is_run_on_start" mapstructure:"is-run-on-start"`
|
||||||
@@ -24,6 +26,8 @@ var configMu sync.Mutex
|
|||||||
const (
|
const (
|
||||||
Url = "url"
|
Url = "url"
|
||||||
Token = "token"
|
Token = "token"
|
||||||
|
HasVideoToken = "has-video-token"
|
||||||
|
NoVideoToken = "no-video-token"
|
||||||
ThreadCount = "thread-count"
|
ThreadCount = "thread-count"
|
||||||
HandleFileCount = "handle-file-count"
|
HandleFileCount = "handle-file-count"
|
||||||
IsRunOnStart = "is-run-on-start"
|
IsRunOnStart = "is-run-on-start"
|
||||||
@@ -36,6 +40,8 @@ func InitConfig() {
|
|||||||
defaultConfig := Config{
|
defaultConfig := Config{
|
||||||
Url: "http://127.0.0.1:8080",
|
Url: "http://127.0.0.1:8080",
|
||||||
Token: "",
|
Token: "",
|
||||||
|
HasVideoToken: "1234",
|
||||||
|
NoVideoToken: "5678",
|
||||||
ThreadCount: 10,
|
ThreadCount: 10,
|
||||||
HandleFileCount: 25,
|
HandleFileCount: 25,
|
||||||
IsRunOnStart: false,
|
IsRunOnStart: false,
|
||||||
@@ -44,6 +50,8 @@ func InitConfig() {
|
|||||||
}
|
}
|
||||||
viper.SetDefault(Url, defaultConfig.Url)
|
viper.SetDefault(Url, defaultConfig.Url)
|
||||||
viper.SetDefault(Token, defaultConfig.Token)
|
viper.SetDefault(Token, defaultConfig.Token)
|
||||||
|
viper.SetDefault(HasVideoToken, defaultConfig.HasVideoToken)
|
||||||
|
viper.SetDefault(NoVideoToken, defaultConfig.NoVideoToken)
|
||||||
viper.SetDefault(ThreadCount, defaultConfig.ThreadCount)
|
viper.SetDefault(ThreadCount, defaultConfig.ThreadCount)
|
||||||
viper.SetDefault(HandleFileCount, defaultConfig.HandleFileCount)
|
viper.SetDefault(HandleFileCount, defaultConfig.HandleFileCount)
|
||||||
viper.SetDefault(IsRunOnStart, defaultConfig.IsRunOnStart)
|
viper.SetDefault(IsRunOnStart, defaultConfig.IsRunOnStart)
|
||||||
|
|||||||
Reference in New Issue
Block a user