func (config *AppConfig) LoadInterceptors() error {
	mode := config.RunMode().String()
	cfgfile := path.Dir(config.Filename())
	cfgfile = strings.TrimSuffix(cfgfile, "/config")
	filename := FindInterceptorConfigFile(mode, cfgfile)
	if strings.HasPrefix(filename, GogoSchema) {
		config.interceptors = DefaultInterceptorConfig
		return nil
	}
	b, err := ioutil.ReadFile(filename)
	if err != nil {
		return err
	}
	err = yaml.Unmarshal(b, &config.interceptors)
	if err != nil {
		config.interceptors = DefaultInterceptorConfig
	}
	return err
}
LoadInterceptors reads all config of interceptors
package gogo
import (
	"fmt"
	"io/ioutil"
	"path"
	"strings"
	"github.com/dolab/gogo/pkgs/interceptors"
	"github.com/dolab/logger"
	yaml "gopkg.in/yaml.v2"
)
var (
	DefaultServerConfig = &ServerConfig{
		Addr:      "127.0.0.1",
		Port:      9090,
		RTimeout:  5,   
		WTimeout:  10,  
		Ssl:       false,
		Healthz:   true,
		RequestID: DefaultRequestIDKey,
	}
	DefaultLoggerConfig = &LoggerConfig{
		Output:       "stderr",
		LevelName:    "info",
		FilterFields: []string{"password", "token"},
	}
	DefaultSectionConfig = &SectionConfig{
		Server: DefaultServerConfig,
		Logger: DefaultLoggerConfig,
	}
	DefaultInterceptorConfig = new(InterceptorConfig)
)
type AppConfig struct {
	Mode     RunMode                 `yaml:"mode"`
	Name     string                  `yaml:"name"`
	Sections map[RunMode]interface{} `yaml:"sections"`
	interceptors *InterceptorConfig
	filename     string
}
func NewAppConfig(filename string) (*AppConfig, error) {
	if strings.HasPrefix(filename, GogoSchema) {
		return NewAppConfigFromDefault()
	}
	b, err := ioutil.ReadFile(filename)
	if err != nil {
		return nil, err
	}
	config, err := NewAppConfigFromString(string(b))
	if err == nil {
		config.filename = filename
	}
	return config, nil
}
func NewAppConfigFromString(s string) (*AppConfig, error) {
	var config *AppConfig
	err := yaml.Unmarshal([]byte(s), &config)
	if err != nil {
		return nil, err
	}
	if !config.Mode.IsValid() {
		config.SetMode(Development)
	}
	if config.Name == "" {
		config.Name = "GOGO"
	}
	return config, nil
}
func NewAppConfigFromDefault() (*AppConfig, error) {
	data, _ := yaml.Marshal(map[string]interface{}{
		"mode": Development,
		"name": "gogo",
		"sections": map[RunMode]interface{}{
			Development: DefaultSectionConfig,
			Test:        DefaultSectionConfig,
			Production:  DefaultSectionConfig,
		},
	})
	return NewAppConfigFromString(string(data))
}
func (config *AppConfig) RunMode() RunMode {
	return config.Mode
}
func (config *AppConfig) RunName() string {
	return config.Name
}
func (config *AppConfig) Filename() string {
	return config.filename
}
func (config *AppConfig) SetMode(mode RunMode) {
	if !mode.IsValid() {
		return
	}
	config.Mode = mode
}
func (config *AppConfig) Section() *SectionConfig {
	var section *SectionConfig
	err := config.UnmarshalYAML(&section)
	if err != nil {
		return DefaultSectionConfig
	}
	return section
}
func (config *AppConfig) UnmarshalJSON(v interface{}) error {
	return fmt.Errorf("DEPRECATED!!! Please use yaml format")
}
func (config *AppConfig) UnmarshalYAML(v interface{}) error {
	section, ok := config.Sections[config.Mode]
	if !ok {
		return ErrConfigSection
	}
	data, err := yaml.Marshal(section)
	if err != nil {
		return err
	}
	return yaml.Unmarshal(data, v)
}
func (config *AppConfig) Interceptors() interceptors.Configer {
	return config.interceptors
}