utils

package
v0.0.0-...-90b322d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DEFAULT_LOCALE = "zh-CN"

	T i18n.TranslateFunc
)

Functions

func FindDir

func FindDir(dir string) (string, bool)

func GetUserTranslations

func GetUserTranslations(locale string) i18n.TranslateFunc

func InitHTML

func InitHTML() error

func InitHTMLWithDir

func InitHTMLWithDir(dir string) error

func TFuncWithFallback

func TFuncWithFallback(pref string) i18n.TranslateFunc

Types

type Config

type Config struct {
	EmailSettings
}

type EmailSettings

type EmailSettings struct {
	EnableSignUpWithEmail             bool
	EnableSignInWithEmail             *bool
	EnableSignInWithUsername          *bool
	FeedbackName                      string
	FeedbackEmail                     string
	FeedbackOrganization              *string
	EnableSMTPAuth                    *bool
	SMTPUsername                      string
	SMTPPassword                      string
	SMTPServer                        string
	SMTPPort                          string
	ConnectionSecurity                string
	SkipServerCertificateVerification *bool
	TempSubject                       string
	TempTitle                         string
	TempInfo                          string
	TempName                          string
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL