feat: updated default plugins implementation
This commit is contained in:
parent
6480101484
commit
f0e27192c8
2 changed files with 53 additions and 8 deletions
|
|
@ -1,16 +1,25 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "git.towk2.me/towk/makeshift/pkg/storage"
|
import (
|
||||||
|
makeshift "git.towk2.me/towk/makeshift/pkg"
|
||||||
|
"git.towk2.me/towk/makeshift/pkg/storage"
|
||||||
|
)
|
||||||
|
|
||||||
type Mapper struct{}
|
type Mapper struct{}
|
||||||
|
|
||||||
func (p *Mapper) Name() string { return "jinja2" }
|
func (p *Mapper) Name() string { return "mapper" }
|
||||||
func (p *Mapper) Version() string { return "test" }
|
func (p *Mapper) Version() string { return "v0.0.1-alpha" }
|
||||||
func (p *Mapper) Description() string { return "Renders Jinja 2 templates" }
|
func (p *Mapper) Description() string { return "Directly maps data to store" }
|
||||||
func (p *Mapper) Metadata() map[string]string {
|
func (p *Mapper) Metadata() makeshift.Metadata {
|
||||||
return map[string]string{
|
return makeshift.Metadata{
|
||||||
"author.name": "David J. Allen",
|
"author": map[string]any{
|
||||||
"author.email": "davidallendj@gmail.com",
|
"name": "David J. Allen",
|
||||||
|
"email": "davidallendj@gmail.com",
|
||||||
|
"links": []string{
|
||||||
|
"https://github.com/davidallendj",
|
||||||
|
"https://git.towk2.me/towk",
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
36
pkg/plugins/user/user.go
Normal file
36
pkg/plugins/user/user.go
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
makeshift "git.towk2.me/towk/makeshift/pkg"
|
||||||
|
"git.towk2.me/towk/makeshift/pkg/storage"
|
||||||
|
)
|
||||||
|
|
||||||
|
type User struct{}
|
||||||
|
|
||||||
|
func (p *User) Name() string { return "user" }
|
||||||
|
func (p *User) Version() string { return "v0.0.1-alpha" }
|
||||||
|
func (p *User) Description() string { return "Get user information" }
|
||||||
|
func (p *User) Metadata() makeshift.Metadata {
|
||||||
|
return makeshift.Metadata{
|
||||||
|
"author": map[string]any{
|
||||||
|
"name": "David J. Allen",
|
||||||
|
"email": "davidallendj@gmail.com",
|
||||||
|
"links": []string{
|
||||||
|
"https://github.com/davidallendj",
|
||||||
|
"https://git.towk2.me/towk",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *User) Init() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *User) Run(store storage.KVStore, args []string) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *User) Cleanup() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue