v2ray-core/plugin.go

19 lines
551 B
Go
Raw Normal View History

2017-11-22 22:00:46 +00:00
package core
2017-11-22 22:15:14 +00:00
// PluginMetadata contains some brief information regarding a plugin.
2017-11-22 22:00:46 +00:00
type PluginMetadata struct {
2017-11-22 22:15:14 +00:00
// Name of the plugin
2017-11-22 22:00:46 +00:00
Name string
}
2017-11-22 22:15:14 +00:00
// GetMetadataFuncName is the name of the function in the plugin to return PluginMetadata.
2017-11-22 22:00:46 +00:00
const GetMetadataFuncName = "GetPluginMetadata"
2017-11-22 22:15:14 +00:00
// GetMetadataFunc is the type of the function in the plugin to return PluginMetadata.
2017-11-22 22:00:46 +00:00
type GetMetadataFunc func() PluginMetadata
2017-11-22 22:15:14 +00:00
// LoadPlugins loads all possible plugins in the 'plugin' directory.
func LoadPlugins() error {
return loadPluginsInternal()
}