g

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 5 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL