Documentation
¶
Index ¶
Constants ¶
View Source
const ( AppName string = "notify-server" AppVersion string = "1.1.2" AppConfigFileName = AppName + ".json" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶
type AppConfig struct {
Debug bool `json:"debug"`
Notifiers struct {
DefaultNotifierID string `json:"default_notifier_id"`
Telegrams []struct {
ID string `json:"id"`
BotToken string `json:"bot_token"`
ChatID int64 `json:"chat_id"`
} `json:"telegrams"`
} `json:"notifiers"`
Tasks []struct {
ID string `json:"id"`
Title string `json:"title"`
Commands []struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Scheduler struct {
Runnable bool `json:"runnable"`
TimeSpec string `json:"time_spec"`
} `json:"scheduler"`
Notifier struct {
Usable bool `json:"usable"`
} `json:"notifier"`
DefaultNotifierID string `json:"default_notifier_id"`
Data map[string]interface{} `json:"data"`
} `json:"commands"`
Data map[string]interface{} `json:"data"`
} `json:"tasks"`
NotifyAPI struct {
WS struct {
TLSServer bool `json:"tls_server"`
TLSCertFile string `json:"tls_cert_file"`
TLSKeyFile string `json:"tls_key_file"`
ListenPort int `json:"listen_port"`
} `json:"ws"`
Applications []struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
DefaultNotifierID string `json:"default_notifier_id"`
AppKey string `json:"app_key"`
} `json:"applications"`
} `json:"notify_api"`
}
Convert JSON to Go struct : https://mholt.github.io/json-to-go/
func InitAppConfig ¶
func InitAppConfig() *AppConfig
Click to show internal directories.
Click to hide internal directories.