提交 2776eeb3 编写于 作者: yanghye's avatar yanghye

修改内置资源XHR代理注释说明

上级 feadef04
......@@ -41,7 +41,7 @@ type LocalLoadResource struct {
// 本地&内置资源加载配置
// 然后使用 Build() 函数构建对象
type LocalLoadConfig struct {
Enable bool // 设置是否启用本地资源缓存到内存, 默认false: 未启用
Enable bool // 设置是否启用本地资源缓存到内存, 默认true: 启用, 禁用时需要调用Disable
EnableCache bool // 启用缓存,将加载过的资源存储到内存中
Domain string // 必须设置的域
Scheme LocalCustomerScheme // 自定义协议, file: 本地磁盘目录加载, fs: 内置到执行程序加载
......@@ -116,6 +116,13 @@ func (m LocalLoadConfig) Build() *LocalLoadConfig {
return config
}
// Disable
// 如果不想启用该代理配置,需要主动调用该函数,仅在应用出始化时有效
func (m *LocalLoadConfig) Disable() *LocalLoadConfig {
m.Enable = false
return m
}
func (m *LocalLoadResource) enable() bool {
if m == nil {
return false
......
......@@ -5,7 +5,6 @@ import (
"github.com/energye/energy/v2/cef"
"github.com/energye/energy/v2/common"
"github.com/energye/energy/v2/consts"
"github.com/energye/energy/v2/logger"
"github.com/energye/golcl/lcl"
//_ "net/http/pprof"
)
......@@ -14,8 +13,8 @@ import (
var resources embed.FS
func main() {
logger.SetEnable(true)
logger.SetLevel(logger.CefLog_Debug)
//logger.SetEnable(true)
//logger.SetLevel(logger.CefLog_Debug)
//全局初始化 每个应用都必须调用的
cef.GlobalInit(nil, &resources)
//创建应用
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册