func (fileHandler *FileHandler) LoadConfigFile(configDir string, appID string, namespace string) (*config.ApolloConfig, error) {
	configFilePath := fileHandler.GetConfigFile(configDir, appID, namespace)
	log.Info("load config file from :", configFilePath)
	c, e := jsonFileConfig.Load(configFilePath, func(b []byte) (interface{}, error) {
		config := &config.ApolloConfig{}
		e := json.NewDecoder(bytes.NewBuffer(b)).Decode(config)
		return config, e
	})
	if c == nil || e != nil {
		log.Errorf("loadConfigFile fail,error:", e)
		return nil, e
	}
	return c.(*config.ApolloConfig), e
}
LoadConfigFile load config from file
package json
import (
	"bytes"
	"encoding/json"
	"fmt"
	"github.com/zouyx/agollo/v4/env/config"
	"sync"
	"github.com/zouyx/agollo/v4/component/log"
	jsonConfig "github.com/zouyx/agollo/v4/env/config/json"
)
const Suffix = ".json"
var (
	jsonFileConfig = &jsonConfig.ConfigFile{}
	configFileMap = make(map[string]string, 1)
	configFileMapLock sync.Mutex
)
type FileHandler struct {
}
func (fileHandler *FileHandler) WriteConfigFile(config *config.ApolloConfig, configPath string) error {
	return jsonFileConfig.Write(config, fileHandler.GetConfigFile(configPath, config.AppID, config.NamespaceName))
}
func (fileHandler *FileHandler) GetConfigFile(configDir string, appID string, namespace string) string {
	key := fmt.Sprintf("%s-%s", appID, namespace)
	configFileMapLock.Lock()
	defer configFileMapLock.Unlock()
	fullPath := configFileMap[key]
	if fullPath == "" {
		filePath := fmt.Sprintf("%s%s", key, Suffix)
		if configDir != "" {
			configFileMap[namespace] = fmt.Sprintf("%s/%s", configDir, filePath)
		} else {
			configFileMap[namespace] = filePath
		}
	}
	return configFileMap[namespace]
}