refactor: combined files defining models

This commit is contained in:
David Allen 2025-08-24 20:38:39 -06:00
parent 2d6eb1d972
commit 7a96bfd6c7
Signed by: towk
GPG key ID: 0430CDBE22619155
3 changed files with 33 additions and 306 deletions

33
pkg/models.go Normal file
View file

@ -0,0 +1,33 @@
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)
}