feat(api): adding api server code

templater can be used as a commmand line tool or as an api server.
This commit is contained in:
2022-03-24 00:49:23 +01:00
parent b22cbcaf78
commit 67e8485958
8 changed files with 348 additions and 41 deletions

17
pkg/utils/main.go Normal file
View File

@ -0,0 +1,17 @@
package utils
import (
"github.com/hashicorp/hcl/v2"
)
func CheckErr(e error) {
if e != nil {
panic(e)
}
}
func CheckDiags(diag hcl.Diagnostics) {
if diag.HasErrors() {
panic(diag.Error())
}
}