conf

package
v0.0.0-...-783c0ba Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

package conf 为配置相关.

Index

Constants

View Source
const (
	MemberDefaultRole = 0
	// 超级管理员.
	MemberSuperRole = 1
	// 普通管理员.
	MemberAdminRole = 2
	// 读者.
	MemberGeneralRole = 3
	// 作者(可以创建项目)
	MemberEditorRole = 4
)

用户权限

View Source
const (
	// 创始人.
	BookFounder = 0
	//管理者
	BookAdmin = 1
	//编辑者.
	BookEditor = 2
	//观察者
	BookObserver = 3
)
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-z0-9_]{2,50}$`
View Source
const RegexpEmail = `^(\w)+(\.\w+)*@(\w)+((\.\w+)+)$`
View Source
const RollPage = 4

Variables

View Source
var (
	Conf config // holds the global app config.
)
View Source
var (
	VERSION string
)

Functions

func GetDatabasePrefix

func GetDatabasePrefix() string

func GetDefaultAvatar

func GetDefaultAvatar() string

获取默认头像

func GetDefaultCover

func GetDefaultCover() string

获取默认文档封面.

func GetTokenSize

func GetTokenSize() int

获取阅读令牌长度.

func GetUploadFileExt

func GetUploadFileExt() []string

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

func Init

func Init() error

func IsAllowUploadFileExt

func IsAllowUploadFileExt(ext string) bool

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

Types

type SmtpConf

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

func GetMailConfig

func GetMailConfig() *SmtpConf

Jump to

Keyboard shortcuts

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