func OptConfig(cfg Config) Option {
	return func(a *App) error {
		var err error
		a.Auth, err = NewAuthManager(OptAuthManagerFromConfig(cfg))
		if err != nil {
			return err
		}
		a.Config = cfg
		a.BaseHeaders = MergeHeaders(BaseHeaders(), CopySingleHeaders(cfg.DefaultHeaders))
		a.Views, err = NewViewCache(OptViewCacheConfig(&cfg.Views))
		return err
	}
}
// OptConfig sets the config.
OptConfig sets the config.
// OptConfig sets the config .
func OptConfig(cfg Config) Option {
	return func(a *App) error {
		var err error
		a.Auth, err = NewAuthManager(OptAuthManagerFromConfig(cfg))
		if err != nil {
			return err
		}
		a.Config = cfg
		a.BaseHeaders = MergeHeaders(BaseHeaders(), CopySingleHeaders(cfg.DefaultHeaders))
		a.Views, err = NewViewCache(OptViewCacheConfig(&cfg.Views))
		return err
	}
}
func OptConfig ( cfg Config ) Option { return func ( a * App ) error { var err error a . Auth , err = NewAuthManager ( OptAuthManagerFromConfig ( cfg ) ) if err != nil { return err } a . Config = cfg a . BaseHeaders = MergeHeaders ( BaseHeaders ( ) , CopySingleHeaders ( cfg . DefaultHeaders ) ) a . Views , err = NewViewCache ( OptViewCacheConfig ( & cfg . Views ) ) return err } }
OptConfig sets the config.
OptConfig sets the config .