diff --git a/LICENSE b/LICENSE index 4bc6dd7..99ada57 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (C) 2024 Matt Dunleavy +Copyright (C) 2024 Matt Dunleavy Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/README.md b/README.md index 766ceab..9e9ab90 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Go Plugin Manager +# Plugin Manager for Go -A robust and flexible plugin management system for Go applications. +A flexible and robust plugin management system for Go applications. ## Features @@ -83,8 +83,9 @@ import ( ) func main() { + // Create a new plugin manager - manager, err := pm.NewManager("config.json", "./plugins") + manager, err := pm.NewManager("plugins.json", "./plugins") if err != nil { log.Fatalf("Failed to create plugin manager: %v", err) } @@ -122,7 +123,7 @@ func main() { ## Configuration -The plugin manager uses a JSON configuration file to keep track of enabled plugins. Here's an example `config.json`: +The plugin manager uses a JSON configuration file to keep track of enabled plugins. Here's an example `plugins.json`: ```json { @@ -135,16 +136,19 @@ The plugin manager uses a JSON configuration file to keep track of enabled plugi ## API Reference -### Manager +- ### Manager -- `NewManager(configPath string, pluginDir string) (*Manager, error)` -- `LoadPlugin(path string) error` -- `UnloadPlugin(name string) error` -- `ExecutePlugin(name string) error` -- `HotReload(name string, path string) error` -- `EnablePlugin(name string) error` -- `DisablePlugin(name string) error` -- `LoadEnabledPlugins(pluginDir string) error` + - `NewManager(configPath string, pluginDir string) (*Manager, error)` + - `LoadPlugin(path string) error` + - `UnloadPlugin(name string) error` + - `ExecutePlugin(name string) error` + - `HotReload(name string, path string) error` + - `EnablePlugin(name string) error` + - `DisablePlugin(name string) error` + - `LoadEnabledPlugins(pluginDir string) error` + - `ListPlugins() []string` + - `GetPluginStats(name string) (*PluginStats, error)` + - `SubscribeToEvent(eventName string, handler EventHandler)` ### EventBus diff --git a/config.go b/config.go index 450b287..9f992b0 100644 --- a/config.go +++ b/config.go @@ -1,3 +1,7 @@ +// Copyright (C) 2024 Matt Dunleavy. All rights reserved. +// Use of this source code is subject to the MIT license +// that can be found in the LICENSE file. + package pluginmanager import ( diff --git a/errors.go b/errors.go index e354225..dff05be 100644 --- a/errors.go +++ b/errors.go @@ -1,3 +1,7 @@ +// Copyright (C) 2024 Matt Dunleavy. All rights reserved. +// Use of this source code is subject to the MIT license +// that can be found in the LICENSE file. + package pluginmanager import "errors" diff --git a/event.go b/event.go index e25213a..15707c9 100644 --- a/event.go +++ b/event.go @@ -1,3 +1,7 @@ +// Copyright (C) 2024 Matt Dunleavy. All rights reserved. +// Use of this source code is subject to the MIT license +// that can be found in the LICENSE file. + package pluginmanager import ( diff --git a/manager.go b/manager.go index dc1e658..70c6a5a 100644 --- a/manager.go +++ b/manager.go @@ -1,4 +1,6 @@ -// File: internal/plugin/manager.go +// Copyright (C) 2024 Matt Dunleavy. All rights reserved. +// Use of this source code is subject to the MIT license +// that can be found in the LICENSE file. package pluginmanager diff --git a/plugin.go b/plugin.go index afd935d..b540d75 100644 --- a/plugin.go +++ b/plugin.go @@ -1,3 +1,7 @@ +// Copyright (C) 2024 Matt Dunleavy. All rights reserved. +// Use of this source code is subject to the MIT license +// that can be found in the LICENSE file. + package pluginmanager import ( diff --git a/sandbox.go b/sandbox.go index 84797d7..6b430ab 100644 --- a/sandbox.go +++ b/sandbox.go @@ -1,3 +1,7 @@ +// Copyright (C) 2024 Matt Dunleavy. All rights reserved. +// Use of this source code is subject to the MIT license +// that can be found in the LICENSE file. + package pluginmanager import (