func Load(path string) *FRPNotifyConfig {
	if cfg := configLoadFunc(path); cfg != nil {
		config = *cfg
	}
	return &config
}
Load config file and parse
package config
import (
	"encoding/json"
	"github/arugal/frp-notify/pkg/logger"
	"io/ioutil"
	"github.com/sirupsen/logrus"
)
var (
	config         FRPNotifyConfig
	configLoadFunc LoadFunc = DefaultConfigLoad
	log *logrus.Logger
)
func init() {
	log = logger.Log
}
type LoadFunc func(path string) *FRPNotifyConfig
func DefaultConfigLoad(path string) *FRPNotifyConfig {
	log.Infof("load config from : %s \n", path)
	content, err := ioutil.ReadFile(path)
	if err != nil {
		log.Fatalln("load config failed, ", err)
	}
	cfg := &FRPNotifyConfig{}
	err = json.Unmarshal(content, cfg)
	if err != nil {
		log.Fatalln("json unmarshal config failed, ", err)
	}
	return cfg
}