https://github.com/nhatthm/plugin-registry-fs
File system installer for Plugin Registry
https://github.com/nhatthm/plugin-registry-fs
filesystem fs go golang plugin plugin-registry registry
Last synced: 4 months ago
JSON representation
File system installer for Plugin Registry
- Host: GitHub
- URL: https://github.com/nhatthm/plugin-registry-fs
- Owner: nhatthm
- License: mit
- Created: 2021-05-05T12:51:54.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2025-03-17T16:54:23.000Z (about 1 year ago)
- Last Synced: 2025-07-09T23:48:04.553Z (11 months ago)
- Topics: filesystem, fs, go, golang, plugin, plugin-registry, registry
- Language: Go
- Homepage:
- Size: 342 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# File system installer for Plugin Registry
[](https://github.com/nhatthm/plugin-registry-fs/releases/latest)
[](https://github.com/nhatthm/plugin-registry-fs/actions/workflows/test.yaml)
[](https://codecov.io/gh/nhatthm/plugin-registry-fs)
[](https://goreportcard.com/report/github.com/nhatthm/plugin-registry-fs)
[](https://pkg.go.dev/github.com/nhatthm/plugin-registry-fs)
[](https://www.paypal.com/donate/?hosted_button_id=PJZSGJN57TDJY)
A file system installer for [plugin-registry](https://github.com/nhatthm/plugin-registry)
## Prerequisites
- `Go >= 1.16`
## Install
```bash
go get github.com/nhatthm/plugin-registry-fs
```
## Usage
Import the library while bootstrapping the application (see the [examples](#examples))
This installer supports installing:
- A binary file
- A folder
- An archive (`.tar.gz`, `.gz.` or `zip`)
The source must be in this format:
```
./my-project/
├── .plugin.registry.yaml
└── my-plugin/
└── (plugin files)
```
For example, if source is an archive, it should be:
```
./my-project/
├── .plugin.registry.yaml
└── my-plugin-1.0.0-darwin-amd64.tar.gz
```
## Examples
```go
package mypackage
import (
"context"
registry "github.com/nhatthm/plugin-registry"
_ "github.com/nhatthm/plugin-registry-fs" // Add file system installer.
)
var defaultRegistry = mustCreateRegistry()
func mustCreateRegistry() registry.Registry {
r, err := createRegistry()
if err != nil {
panic(err)
}
return r
}
func createRegistry() (registry.Registry, error) {
return registry.NewRegistry("~/plugins")
}
func installPlugin(source string) error {
return defaultRegistry.Install(context.Background(), source)
}
```
## Donation
If this project help you reduce time to develop, you can give me a cup of coffee :)
### Paypal donation
[](https://www.paypal.com/donate/?hosted_button_id=PJZSGJN57TDJY)
or scan this