Documentation ¶
Index ¶
- Constants
- Variables
- func AddConfigListener(listener func(*model.Config, *model.Config)) string
- func DisableConfigWatch()
- func DisableDebugLogForTest()
- func EnableConfigFromEnviromentVars()
- func EnableConfigWatch()
- func EnableDebugLogForTest()
- func FileExistsInConfigFolder(filename string) bool
- func FindConfigFile(fileName string) string
- func FindDir(dir string) (string, bool)
- func GetDisplayName(user *model.User) string
- func GetHostnameFromSiteURL(siteURL string) string
- func GetIpAddress(r *http.Request) string
- func GetLogFileLocation(fileLocation string) string
- func GetSiteURL() string
- func GetSupportedLocales() map[string]string
- func GetTranslationsAndLocale(w http.ResponseWriter, r *http.Request) (i18n.TranslateFunc, string)
- func GetTranslationsBySystemLocale() (i18n.TranslateFunc, error)
- func GetUserTranslations(locale string) i18n.TranslateFunc
- func HttpClient(trustURLs bool) *http.Client
- func InitAndLoadConfig(filename string) error
- func InitHTML()
- func InitHTMLWithDir(dir string)
- func InitTranslations(localizationSettings model.LocalizationSettings) error
- func InitTranslationsWithDir(dir string) error
- func InitializeConfigWatch()
- func IsPasswordValid(password string) *model.AppError
- func LoadConfig(fileName string)
- func MapToJson(objmap map[string]string) string
- func RegenerateClientConfig()
- func RemoveConfigListener(id string)
- func RemoveDuplicatesFromStringArray(arr []string) []string
- func RenderWebError(err *model.AppError, w http.ResponseWriter, r *http.Request)
- func SaveConfig(fileName string, config *model.Config) *model.AppError
- func SendMail(to, subject, body string) *model.AppError
- func SendMailUsingConfig(to, subject, body string, config *model.Config) *model.AppError
- func SetDefaultRolesBasedOnConfig()
- func SetSiteURL(url string)
- func SetTranslations(locale string) i18n.TranslateFunc
- func StringArrayContains(arr1, arr2 []string) bool
- func StringArrayIntersection(arr1, arr2 []string) []string
- func TfuncWithFallback(pref string) i18n.TranslateFunc
- func TranslationsPreInit() error
- func UrlEncode(str string) string
- func ValidateLocales(cfg *model.Config) *model.AppError
- type Cache
- func (c *Cache) Add(key, value interface{}) bool
- func (c *Cache) AddWithExpiresInSecs(key, value interface{}, expireAtSecs int64) bool
- func (c *Cache) Get(key interface{}) (value interface{}, ok bool)
- func (c *Cache) Keys() []interface{}
- func (c *Cache) Len() int
- func (c *Cache) Purge()
- func (c *Cache) Remove(key interface{})
- func (c *Cache) RemoveOldest()
- type DialContextFunction
- type HTMLTemplate
Constants ¶
View Source
const ( MODE_DEV = "dev" MODE_BETA = "beta" MODE_PROD = "prod" LOG_ROTATE_SIZE = 10000 LOG_FILENAME = "sso.log" )
Variables ¶
View Source
var AddressForbidden error = errors.New("address forbidden")
View Source
var Cfg *model.Config = &model.Config{}
View Source
var CfgDisableConfigWatch = false
View Source
var CfgFileName string = ""
View Source
var CfgHash = ""
View Source
var ClientCfg map[string]string = map[string]string{}
View Source
var ClientCfgHash = ""
View Source
var T i18n.TranslateFunc
View Source
var TDefault i18n.TranslateFunc
Functions ¶
func DisableConfigWatch ¶
func DisableConfigWatch()
func DisableDebugLogForTest ¶
func DisableDebugLogForTest()
func EnableConfigFromEnviromentVars ¶
func EnableConfigFromEnviromentVars()
func EnableConfigWatch ¶
func EnableConfigWatch()
func EnableDebugLogForTest ¶
func EnableDebugLogForTest()
func FindConfigFile ¶
func GetDisplayName ¶
func GetHostnameFromSiteURL ¶
func GetIpAddress ¶
func GetLogFileLocation ¶
func GetSiteURL ¶
func GetSiteURL() string
func GetSupportedLocales ¶
func GetTranslationsAndLocale ¶
func GetTranslationsAndLocale(w http.ResponseWriter, r *http.Request) (i18n.TranslateFunc, string)
func GetTranslationsBySystemLocale ¶
func GetTranslationsBySystemLocale() (i18n.TranslateFunc, error)
func GetUserTranslations ¶
func GetUserTranslations(locale string) i18n.TranslateFunc
func HttpClient ¶
func InitAndLoadConfig ¶
func InitHTMLWithDir ¶
func InitHTMLWithDir(dir string)
func InitTranslations ¶
func InitTranslations(localizationSettings model.LocalizationSettings) error
func InitTranslationsWithDir ¶
func InitializeConfigWatch ¶
func InitializeConfigWatch()
func IsPasswordValid ¶
func LoadConfig ¶
func LoadConfig(fileName string)
func RegenerateClientConfig ¶
func RegenerateClientConfig()
func RemoveConfigListener ¶
func RemoveConfigListener(id string)
func RenderWebError ¶
func SendMailUsingConfig ¶
func SetDefaultRolesBasedOnConfig ¶
func SetDefaultRolesBasedOnConfig()
func SetSiteURL ¶
func SetSiteURL(url string)
func SetTranslations ¶
func SetTranslations(locale string) i18n.TranslateFunc
func StringArrayContains ¶
func StringArrayIntersection ¶
func TfuncWithFallback ¶
func TfuncWithFallback(pref string) i18n.TranslateFunc
func TranslationsPreInit ¶
func TranslationsPreInit() error
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func NewLruWithEvict ¶
func (*Cache) AddWithExpiresInSecs ¶
func (*Cache) RemoveOldest ¶
func (c *Cache) RemoveOldest()
type DialContextFunction ¶
type HTMLTemplate ¶
type HTMLTemplate struct { TemplateName string Props map[string]interface{} Html map[string]template.HTML Locale string }
func NewHTMLTemplate ¶
func NewHTMLTemplate(templateName string, locale string) *HTMLTemplate
func (*HTMLTemplate) Render ¶
func (t *HTMLTemplate) Render() string
func (*HTMLTemplate) RenderToWriter ¶
func (t *HTMLTemplate) RenderToWriter(w http.ResponseWriter) error
Click to show internal directories.
Click to hide internal directories.