mirror of
https://github.com/lancatlin/mdsh.git
synced 2026-11-06 03:30:13 +08:00
27 lines
463 B
Go
27 lines
463 B
Go
package main
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
type TemplateMeta struct {
|
|
Output string `yaml:"output"`
|
|
Params map[string]ParamSpec `yaml:"params"`
|
|
}
|
|
|
|
func (meta TemplateMeta) String() string {
|
|
data, err := json.Marshal(meta)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return string(data)
|
|
}
|
|
|
|
type ParamSpec struct {
|
|
Required bool `yaml:"required"`
|
|
Default string `yaml:"default"`
|
|
Usage string `yaml:"usage"`
|
|
}
|
|
|
|
type TemplateContext map[string]string
|