makeshift/pkg/models.go

32 lines
804 B
Go

package makeshift
import "git.towk2.me/towk/makeshift/pkg/storage"
type ProfileMap map[string]*Profile
type Profile struct {
ID string `json:"id"` // profile ID
Description string `json:"description,omitempty"` // profile description
Tags []string `json:"tags,omitempty"` // tags used for ...
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)
}