97 lines
4.6 KiB
Go
97 lines
4.6 KiB
Go
package cfgsrv
|
|
|
|
type DataStore string
|
|
const (
|
|
DsFile DataStore = "fs"
|
|
DsRedis = "redis"
|
|
)
|
|
type TemplateItem struct {
|
|
Path string `yaml:"path" json:"path"`
|
|
Route string `yaml:"route" json:"route"`
|
|
}
|
|
type RouteItem struct {
|
|
Path string `yaml:"path" json:"path"`
|
|
Param string `yaml:"param" json:"param"`
|
|
}
|
|
type MailTemplateItem struct {
|
|
Path string `yaml:"path" json:"path"`
|
|
Type string `yaml:"type" json:"type"`
|
|
}
|
|
type Config struct {
|
|
PubUser string `yaml:"pubUser" json:"pubUser"`
|
|
UsersPath string `yaml:"usersPath" json:"usersPath"`
|
|
UsersModelsPath string `yaml:"usersModelsPath" json:"usersModelsPath"`
|
|
LogOut string `yaml:"logOut" json:"logOut"`
|
|
RequestOut string `yaml:"requestOut" json:"requestOut"`
|
|
RequestStore DataStore `yaml:"requestStore" json:"requestStore"`
|
|
TrackingOut string `yaml:"trackingOut" json:"trackingOut"`
|
|
TrackingStore DataStore `yaml:"trackingStore" json:"trackingStore"`
|
|
Host string `yaml:"host" json:"host"`
|
|
Port int `yaml:"port" json:"port"`
|
|
Protocol string `yaml:"protocol" json:"protocol"`
|
|
KeyPem string `yaml:"keyPem" json:"keyPem"`
|
|
CertPem string `yaml:"certPem" json:"certPem"`
|
|
AllowOrigins []string `yaml:"allowOrigins" json:"allowOrigins"`
|
|
UseJWT bool `yaml:"useJWT" json:"useJWT"`
|
|
JwtRealm string `yaml:"jwtRealm" json:"jwtRealm"`
|
|
JwtKey string `yaml:"jwtKey" json:"jwtKey"`
|
|
JwtTimeout int64 `yaml:"jwtTimeout" json:"jwtTimeout"`
|
|
JwtMaxRefresh int64 `yaml:"jwtMaxRefresh" json:"jwtMaxRefresh"`
|
|
JwtKeyPem string `yaml:"jwtKeyPem" json:"jwtKeyPem"`
|
|
JwtCertPem string `yaml:"jwtCertPem" json:"jwtCertPem"`
|
|
SigningAlgorithm string `yaml:"signingAlgorithm" json:"signingAlgorithm"`
|
|
AuthSep string `yaml:"authSep" json:"authSep"`
|
|
PasswdEnc string `yaml:"passwdEnc" json:"passwdEnc"`
|
|
InvitationsPath string `yaml:"invitationsPath" json:"invitationsPath"`
|
|
RecoveryTime int `yaml:"recoveryTime" json:"recoveryTime"`
|
|
UseAuthz bool `yaml:"useAuthz" json:"useAuthz"`
|
|
AuthzModel string `yaml:"authzModel" json:"authzModel"`
|
|
AuthzPolicy string `yaml:"authzPolicy" json:"authzPolicy"`
|
|
AdminRole string `yaml:"adminRole" json:"adminRole"`
|
|
IdentityKey string `yaml:"identityKey" json:"identityKey"`
|
|
UsersStore DataStore `yaml:"usersStore" json:"usersStore"`
|
|
RootAuthGroup string `yaml:"rootAuthGroup" json:"rootAuthGroup"`
|
|
Routes map[string]RouteItem `yaml:"routes" json:"routes"`
|
|
TemplatesRoot string `yaml:"templatesRoot" json:"templatesRoot"`
|
|
TemplatesExt string `yaml:"templatesExt" json:"templatesExt"`
|
|
TemplatesIncludes string `yaml:"templatesIncludes" json:"templatesIncludes"`
|
|
TemplatesLayouts string `yaml:"templatesLayouts" json:"templatesLayouts"`
|
|
TemplatesFiles map[string]TemplateItem `yaml:"templatesFiles" json:"templatesFiles"`
|
|
AssetsPath string `yaml:"assetsPath" json:"assetsPath"`
|
|
AssetsURL string `yaml:"assetsURL" json:"assetsURL"`
|
|
UseDist bool `yaml:"useDist" json:"useDist"`
|
|
GenDist bool `yaml:"genDist" json:"genDist"`
|
|
GenExcludeList []string `yaml:"genExcludeList" json:"genExcludeList"`
|
|
DataDistPath string `yaml:"dataDistPath" json:"dataDistPath"`
|
|
DataPath string `yaml:"dataPath" json:"dataPath"`
|
|
DataModelsRoot string `yaml:"dataModelsRoot" json:"dataModelsRoot"`
|
|
DataCorePath string `yaml:"dataCorePath" json:"dataCorePath"`
|
|
DataDflt string `yaml:"dataDflt" json:"dataDflt"`
|
|
DataItems []string `yaml:"dataItems" json:"dataItems"`
|
|
DataStore DataStore `yaml:"dataStore" json:"dataStore"`
|
|
MainLang string `yaml:"mainLang" json:"mainLang"`
|
|
Langs []string `yaml:"langs" json:"langs"`
|
|
DebugLevel int `yaml:"debugLevel" json:"debugLevel"`
|
|
UseRepo bool `yaml:"useRepo" json:"useRepo"`
|
|
UseRepoOnReq bool `yaml:"useRepoOnReq" json:"useRepoOnReq"`
|
|
RepoPath string `yaml:"repoPath" json:"repoPath"`
|
|
RepoName string `yaml:"repoName" json:"repoName"`
|
|
RepoCommit string `yaml:"repoCommit" json:"repoCommit"`
|
|
BackgGit bool `yaml:"backgGit" json:"backgGit"`
|
|
QuietGit bool `yaml:"quietGit" json:"quietGit"`
|
|
MailHost string `yaml:"mailHost" json:"mailHost"`
|
|
MailPort int `yaml:"mailPort" json:"mailPort"`
|
|
MailFrom string `yaml:"mailFrom" json:"mailFrom"`
|
|
MailUser string `yaml:"mailUser" json:"mailUser"`
|
|
MailPswd string `yaml:"mailPswd" json:"mailPswd"`
|
|
MailCertPath string `yaml:"mailCertPath" json:"mailCertPath"`
|
|
MailCertDom string `yaml:"mailCertDom" json:"mailCertDom"`
|
|
TplsMailPath string `yaml:"tplsMailPath" json:"tplsMailPath"`
|
|
TplsMail map[string]MailTemplateItem `yaml:"tplsMail" json:"tplsMail"`
|
|
OpenBrowser bool `yaml:"openBrowser" json:"openBrowser"`
|
|
RedisHost string `yaml:"redisHost" json:"redisHost"`
|
|
RedisPort int `yaml:"redisPort" json:"redisPort"`
|
|
RedisDB string `yaml:"redisDB" json:"redisDB"`
|
|
RedisPswd string `yaml:"redisPswd" json:"redisPswd"`
|
|
}
|