Documentation
¶
Index ¶
- Variables
- func BuildPluginAssetsFSController(le *logrus.Entry, b bus.Bus, pluginHostClient srpc.Client, pluginID string) *unixfs_access.Controller
- func BuildPluginDistFSController(le *logrus.Entry, b bus.Bus, pluginHostClient srpc.Client, pluginID string) *unixfs_access.Controller
- func ExecutePluginEntrypoint(rctx context.Context, le *logrus.Entry, meta *bldr_plugin.PluginMeta, ...) error
- func Main(pluginStartInfoJsonB64, pluginMetaB58 string, logLevel logrus.Level, ...)
- func PluginDevInfoFromFile(filePath string) (*vardef.PluginDevInfo, error)
- func Run(ctx context.Context, le *logrus.Entry, ...) error
- func UnmarshalPluginMeta(pluginMetaB58 string) (*bldr_plugin.PluginMeta, error)
- func UnmarshalPluginStartInfo(pluginStartInfoJsonB64 string) (*bldr_plugin.PluginStartInfo, error)
- type AddFactoryFunc
- type BuildConfigSetFunc
Constants ¶
This section is empty.
Variables ¶
var Version = semver.MustParse("0.0.1")
Version is the entrypoint version
Functions ¶
func BuildPluginAssetsFSController ¶
func BuildPluginAssetsFSController(le *logrus.Entry, b bus.Bus, pluginHostClient srpc.Client, pluginID string) *unixfs_access.Controller
BuildPluginAssetsFSController builds a unixfs_access controller for the plugin assets.
func BuildPluginDistFSController ¶
func BuildPluginDistFSController(le *logrus.Entry, b bus.Bus, pluginHostClient srpc.Client, pluginID string) *unixfs_access.Controller
BuildPluginDistFSController builds a unixfs_access controller for the plugin dist fs.
func ExecutePluginEntrypoint ¶
func ExecutePluginEntrypoint( rctx context.Context, le *logrus.Entry, meta *bldr_plugin.PluginMeta, addFactoryFuncs []AddFactoryFunc, configSetFuncs []BuildConfigSetFunc, pluginHostClient srpc.Client, acceptPluginHostStreams func(ctx context.Context, srv *srpc.Server) error, ) error
ExecutePluginEntrypoint builds the bus & starts common controllers.
func Main ¶
func Main( pluginStartInfoJsonB64, pluginMetaB58 string, logLevel logrus.Level, addFactoryFuncs []AddFactoryFunc, configSetFuncs []BuildConfigSetFunc, )
Main runs the default main entrypoint for a plugin.
func PluginDevInfoFromFile ¶
func PluginDevInfoFromFile(filePath string) (*vardef.PluginDevInfo, error)
PluginDevInfoFromFile loads a PluginDevInfo object from a .bin file.
func Run ¶
func Run( ctx context.Context, le *logrus.Entry, pluginStartInfo *bldr_plugin.PluginStartInfo, pluginMeta *bldr_plugin.PluginMeta, addFactoryFuncs []AddFactoryFunc, configSetFuncs []BuildConfigSetFunc, ) error
Run runs the plugin entrypoint.
func UnmarshalPluginMeta ¶
func UnmarshalPluginMeta(pluginMetaB58 string) (*bldr_plugin.PluginMeta, error)
UnmarshalPluginMeta unmarshals the plugin meta information.
func UnmarshalPluginStartInfo ¶
func UnmarshalPluginStartInfo(pluginStartInfoJsonB64 string) (*bldr_plugin.PluginStartInfo, error)
UnmarshalPluginStartInfo unmarshals the plugin start information.
Types ¶
type AddFactoryFunc ¶
type AddFactoryFunc func(b bus.Bus) []controller.Factory
AddFactoryFunc is a callback to add a factory.
type BuildConfigSetFunc ¶
type BuildConfigSetFunc func(ctx context.Context, b bus.Bus, le *logrus.Entry) ([]configset.ConfigSet, error)
BuildConfigSetFunc is a function to build a list of ConfigSet to apply.
func ConfigSetFuncFromFS ¶
func ConfigSetFuncFromFS(ifs fs.FS, fileName string) BuildConfigSetFunc
ConfigSetFuncFromFS builds a ConfigSetFunc which parses a file in a FS as a ConfigSet.