33 lines
925 B
Go
33 lines
925 B
Go
package makeshift
|
|
|
|
import "git.towk2.me/towk/makeshift/pkg/storage"
|
|
|
|
type Profile struct {
|
|
ID string `json:"id"` // profile ID
|
|
Description string `json:"description,omitempty"` // profile description
|
|
Tags []string `json:"tags,omitempty"` // tags used for ...
|
|
Paths []string `json:"paths,omitempty"` // paths to download
|
|
Plugins []string `json:"plugins,omitempty"` // plugins to run
|
|
Data map[string]any `json:"data,omitempty"` // include render data
|
|
}
|
|
|
|
type Plugin interface {
|
|
Name() string
|
|
Version() string
|
|
Description() string
|
|
Metadata() Metadata
|
|
|
|
Init() error
|
|
Run(data storage.KVStore, args []string) error
|
|
Cleanup() error
|
|
}
|
|
type Metadata map[string]any
|
|
type Hook struct {
|
|
Data storage.KVStore
|
|
Args []string
|
|
Plugin Plugin
|
|
}
|
|
|
|
func (h *Hook) Run() error {
|
|
return h.Plugin.Run(h.Data, h.Args)
|
|
}
|