conf

package
v2.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

package conf 为配置相关.

Index

Constants

View Source
const (
	LoggerOperate   = "operate"
	LoggerSystem    = "system"
	LoggerException = "exception"
	LoggerDocument  = "document"
)
View Source
const (
	//本地账户校验
	AuthMethodLocal = "local"
	//LDAP用户校验
	AuthMethodLDAP = "ldap"
)
View Source
const CaptchaSessionName = "__captcha__"
View Source
const LoginSessionName = "LoginSessionName"

登录用户的Session名

View Source
const PageSize = 10

PageSize 默认分页条数.

View Source
const RegexpAccount = `^[a-zA-Z][a-zA-Z0-9\.]{2,50}$`

允许用户名中出现点号

View Source
const RegexpEmail = "" /* 135-byte string literal not displayed */

Variables

View Source
var (
	VERSION    string
	BUILD_TIME string
	GO_VERSION string
)
View Source
var (
	ConfigurationFile = "./conf/app.conf"
	WorkingDirectory  = "./"
	LogFile           = "./runtime/logs"
	BaseUrl           = ""
	AutoLoadDelay     = 0
)

Functions

func GetAppKey

func GetAppKey() string

app_key

func GetDatabasePrefix

func GetDatabasePrefix() string

func GetDefaultAvatar

func GetDefaultAvatar() string

获取默认头像

func GetDefaultCover

func GetDefaultCover() string

获取默认文档封面.

func GetEnableExport

func GetEnableExport() bool

是否启用导出

func GetExportLimitNum

func GetExportLimitNum() int

导出项目队列的并发数量

func GetExportOutputPath

func GetExportOutputPath() string

默认导出项目的缓存目录

func GetExportProcessNum

func GetExportProcessNum() int

同一项目导出线程的并发数

func GetExportQueueLimitNum

func GetExportQueueLimitNum() int

等待导出队列的长度

func GetTokenSize

func GetTokenSize() int

获取阅读令牌长度.

func GetUploadFileExt

func GetUploadFileExt() []string

获取允许的商城文件的类型.

func GetUploadFileSize

func GetUploadFileSize() int64

获取上传文件允许的最大值

func IsAllowUploadFileExt

func IsAllowUploadFileExt(ext string) bool

判断是否是允许商城的文件类型.

func URLFor

func URLFor(endpoint string, values ...interface{}) string

重写生成URL的方法,加上完整的域名

func URLForNotHost

func URLForNotHost(endpoint string, values ...interface{}) string

func URLForWithCdnCss

func URLForWithCdnCss(p string, v ...string) string

func URLForWithCdnImage

func URLForWithCdnImage(p string) string

func URLForWithCdnJs

func URLForWithCdnJs(p string, v ...string) string

func WorkingDir

func WorkingDir(elem ...string) string

Types

type BookRole

type BookRole int

项目角色

const (
	// 创始人.
	BookFounder BookRole = iota
	//管理者
	BookAdmin
	//编辑者.
	BookEditor
	//观察者
	BookObserver
)

type SmtpConf

type SmtpConf struct {
	EnableMail   bool
	MailNumber   int
	SmtpUserName string
	SmtpHost     string
	SmtpPassword string
	SmtpPort     int
	FormUserName string
	MailExpired  int
	Secure       string
}

func GetMailConfig

func GetMailConfig() *SmtpConf

type SystemRole

type SystemRole int

系统角色

const (
	// 超级管理员.
	MemberSuperRole SystemRole = iota
	//普通管理员.
	MemberAdminRole
	//普通用户.
	MemberGeneralRole
)

用户权限

Jump to

Keyboard shortcuts

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