forked from edwingeng/hotswap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zhengyang.zhu
committed
Mar 13, 2024
1 parent
2888948
commit d666bca
Showing
5 changed files
with
82 additions
and
48 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
package sdk | ||
|
||
import "github.com/sandwich-go/hotswap" | ||
import ( | ||
"time" | ||
|
||
"github.com/sandwich-go/hotswap" | ||
) | ||
|
||
//go:generate optionGen --v=true --xconf=false --usage_tag_name=usage | ||
func PluginSpecOptionDeclareWithDefault() interface{} { | ||
return map[string]interface{}{ | ||
"MountDir": "/mount/data", // annotation@MountDir(comment="磁盘挂载目录") | ||
"HotReload": true, // annotation@HotReload(comment="允许热更新,开启watch目录") | ||
"DirsToKeep": 10, // annotation@DirsToKeep(comment="同一service, 磁盘保留发布的目录数") | ||
"InternalDir": "bin/plugin", // annotation@InternalDir(comment="service pod内部携带的plugin目录") | ||
"OnFirstLoadData": interface{}(nil), // annotation@OnFirstLoadData(comment="第一次OnLoad的data参数") | ||
"OnReloadData": interface{}(nil), // annotation@OnReloadData(comment="热更时新插件OnLoad的data参数") | ||
"HotswapSpec": (*hotswap.Spec)(hotswap.NewSpec()), // annotation@Spec(comment="hotswap参数") | ||
"MountDir": "/mount/data", // annotation@MountDir(comment="磁盘挂载目录") | ||
"HotReload": true, // annotation@HotReload(comment="允许热更新,开启watch目录") | ||
"DirsToKeep": 10, // annotation@DirsToKeep(comment="同一service, 磁盘保留发布的目录数") | ||
"InternalDir": "bin/plugin", // annotation@InternalDir(comment="service pod内部携带的plugin目录") | ||
"OnFirstLoadData": interface{}(nil), // annotation@OnFirstLoadData(comment="第一次OnLoad的data参数") | ||
"OnReloadData": interface{}(nil), // annotation@OnReloadData(comment="热更时新插件OnLoad的data参数") | ||
"FreeDelay": time.Duration(15 * time.Second), // annotation@FreeDelay(comment="the delay time of calling OnFree. The default value is 5 minutes.") | ||
"ExtensionNewer": (func() interface{})(nil), // annotation@ExtensionNewer(comment="the function used to create a new object for PluginManager.Vault.Extension.") | ||
"StaticPlugins": map[string]*hotswap.StaticPlugin(nil), // annotation@StaticPlugins(comment="the static plugins for static linking. 宿主程序直接编译的插件 用做debug和windows") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters