Kevin Wan 2 years ago committed by GitHub
parent c638fce31c
commit d20d8324e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,9 @@
package config
import {{.authImport}}
type Config struct {
rest.RestConf
{{.auth}}
{{.jwtTrans}}
}

@ -1,6 +1,7 @@
package gogen
import (
_ "embed"
"fmt"
"strings"
@ -11,17 +12,7 @@ import (
)
const (
configFile = "config"
configTemplate = `package config
import {{.authImport}}
type Config struct {
rest.RestConf
{{.auth}}
{{.jwtTrans}}
}
`
configFile = "config"
jwtTemplate = ` struct {
AccessSecret string
@ -35,6 +26,9 @@ type Config struct {
`
)
//go:embed config.tpl
var configTemplate string
func genConfig(dir string, cfg *config.Config, api *spec.ApiSpec) error {
filename, err := format.FileNamingFormat(cfg.NamingFormat, configFile)
if err != nil {

Loading…
Cancel
Save