app

package
v0.0.0-...-58bd1cf Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 19 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// LogConfigFile log config file
	LogConfigFile = "conf/log.ini"

	// Database Config table init file
	DBConfigFile = "conf/config.csv"

	// Schema DDL sql file
	SQLSchemaFile = "conf/schema.sql"

	// SAML certificate file
	SAMLCertificateFile = "conf/xdemo.cer"

	// SAML cert key file
	SAMLCertKeyFile = "conf/xdemo.key"
)
View Source
const (
	ExitOK int = iota
	ExitErrLOG
	ExitErrCFG
	ExitErrTXT
	ExitErrTPL
	ExitErrDB
	ExitErrTCP
	ExitErrFSW
	ExitErrSCH
	ExitErrHTTP
	ExitErrCMD
)
View Source
const (
	DateFormat = "2006-01-02"
	TimeFormat = "2006-01-02 15:04:05"
)

Variables

View Source
var (
	// Version app version
	Version string

	// Revision app revision
	Revision string

	// BuildTime app build time
	BuildTime, _ = time.ParseInLocation("2006-01-02T15:04:05Z", buildTime, time.UTC)

	// StartupTime app start time
	StartupTime = time.Now()
)

inject by go build

View Source
var (
	// CFG global ini map
	CFG map[string]map[string]string

	// Locales supported languages
	Locales []string

	// Domain site domain
	Domain string

	// Base web context path
	Base string

	// WAS web assets filesystem
	WAS http.FileSystem

	// VAD global validate
	VAD *vad.Validate

	// XIN global xin engine
	XIN *xin.Engine

	// XAL global xin access logger
	XAL *xmw.AccessLogger

	// XRL global xin request limiter
	XRL *xmw.RequestLimiter

	// XRC global xin response compressor
	XRC *xmw.ResponseCompressor

	// XHD global xin http dumper
	XHD *xmw.HTTPDumper

	// XSR global xin https redirector
	XSR *xmw.HTTPSRedirector

	// XLL global xin localizer
	XLL *xmw.Localizer

	// XTP global xin token protector
	XTP *xmw.TokenProtector

	// XRH global xin response header middleware
	XRH *xmw.ResponseHeader

	// XAC global xin origin access controller middleware
	XAC *xmw.OriginAccessController

	// XCC global xin static cache control setter
	XCC *xin.CacheControlSetter

	// XBA global basic auth middleware
	XBA *xmw.BasicAuth

	// XCA global cookie auth middleware
	XCA *xmw.CookieAuth

	// XCN global cookie auth middleware (no failure)
	XCN *xmw.CookieAuth

	// XHT global xin html templates
	XHT render.HTMLTemplates

	// TCP listener dumper
	TCP *netutil.ListenerDumper

	// HTTP global http server
	HTTP *http.Server

	// DBS database settings
	DBS map[string]string

	// SDB sqx database instance
	SDB *sqlx.DB

	// Certificate X509 KeyPair
	Certificate *tls.Certificate

	// SCMAS schema cache
	SCMAS *imc.Cache[bool]

	// CONFS tenant config map cache
	CONFS *imc.Cache[map[string]string]

	// USERS tenant user cache
	USERS *imc.Cache[*models.User]

	// AFIPS authenticate failure ip cache
	AFIPS *imc.Cache[int]
)
View Source
var (
	// AppConfigFile app config file
	AppConfigFiles = []string{"conf/app.ini", "conf/env.ini"}
)

Functions

func Exit

func Exit(code int)

func FormatDate

func FormatDate(t time.Time) string

func FormatTime

func FormatTime(t time.Time) string

func MakeFileID

func MakeFileID(prefix, name string) string

func Secret

func Secret() string

func Versions

func Versions() string

Types

This section is empty.

Jump to

Keyboard shortcuts

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