Documentation
¶
Index ¶
- func DisablePreviewMode() bool
- func FileExist(path string) bool
- func GetConfigBatchSize() int
- func GetConfigBool(key string) bool
- func GetConfigDataSourceName() string
- func GetConfigInt(key string) int
- func GetConfigString(key string) string
- func GetLanguage(language string) string
- func GetStringArray(key string) []string
- func IsDemoMode() bool
- func IsPreviewMode() bool
- func ReadGlobalConfigTokens() []string
- func ReadStringFromPath(path string) string
- type WebConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisablePreviewMode ¶ added in v1.790.3
func DisablePreviewMode() bool
DisablePreviewMode resolves the disablePreviewMode toggle. It is the ONE place the preview-mode value is read, so it can never be resolved two ways. Preview mode is the UNAUTHENTICATED, development-only relaxation; disabling it is what production wants.
Resolution order (env beats file so ops can flip it on the DEPLOYED cloud CR with NO rebuild — the reversible, durable lever):
- DISABLE_PREVIEW_MODE env — "true" (case-insensitive) => preview OFF.
- disablePreviewMode app.conf key (standalone/local dev).
A security kill-switch gets its own explicit UPPER_SNAKE env name rather than riding the generic GetConfigString passthrough (whose env key would be the camelCase config name) — one unambiguous lever for one decision.
func GetConfigBatchSize ¶
func GetConfigBatchSize() int
func GetConfigBool ¶
func GetConfigDataSourceName ¶
func GetConfigDataSourceName() string
func GetConfigInt ¶
func GetConfigString ¶
func GetLanguage ¶
func GetStringArray ¶
func IsDemoMode ¶
func IsDemoMode() bool
func IsPreviewMode ¶ added in v1.790.3
func IsPreviewMode() bool
IsPreviewMode reports whether the server is in preview mode: the unauthenticated dev relaxation. It is the semantic every caller wants; it and DisablePreviewMode are the ONLY readers of the toggle. Callers must use these and never read the raw config key, so the env lever governs every call site.
func ReadGlobalConfigTokens ¶
func ReadGlobalConfigTokens() []string
func ReadStringFromPath ¶
Types ¶
type WebConfig ¶
type WebConfig struct {
AuthConfig struct {
ServerUrl string `json:"serverUrl"`
ClientId string `json:"clientId"`
AppName string `json:"appName"`
OrganizationName string `json:"organizationName"`
RedirectPath string `json:"redirectPath"`
} `json:"authConfig"`
EnableExtraPages bool `json:"enableExtraPages"`
ShortcutPageItems []string `json:"shortcutPageItems"`
UsageEndpoints []string `json:"usageEndpoints"`
IframeUrl string `json:"iframeUrl"`
ForceLanguage string `json:"forceLanguage"`
DefaultLanguage string `json:"defaultLanguage"`
StaticBaseUrl string `json:"staticBaseUrl"`
HtmlTitle string `json:"htmlTitle"`
FaviconUrl string `json:"faviconUrl"`
LogoUrl string `json:"logoUrl"`
AppUrl string `json:"appUrl"`
ShowGithubCorner bool `json:"showGithubCorner"`
IsDemoMode bool `json:"isDemoMode"`
DisablePreviewMode bool `json:"disablePreviewMode"`
ThemeDefault struct {
ThemeType string `json:"themeType"`
ColorPrimary string `json:"colorPrimary"`
BorderRadius int `json:"borderRadius"`
IsCompact bool `json:"isCompact"`
} `json:"themeDefault"`
AvatarErrorUrl string `json:"avatarErrorUrl"`
}
func GetWebConfig ¶
func GetWebConfig() *WebConfig