setting

package
v0.0.0-...-a64d9b0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2020 License: GPL-3.0 Imports: 18 Imported by: 14

Documentation

Index

Constants

View Source
const (
	LangEnUS = iota
	LangZhCN
)
View Source
const (
	APP_VER = "1.0.0.1"
)

Variables

View Source
var (
	AppName             string
	AppVer              string
	AppHost             string
	AppUrl              string
	ImgBedUrl           string
	QiniuEnabled        bool
	QiniuUrl            string
	QiniuAppKey         string
	QiniuSecretKey      string
	QiniuBucketName     string
	UpYunEnabled        bool
	UpYunUrl            string
	UpYunUsername       string
	UpYunPassword       string
	UpYunBucketName     string
	ReadabilityAppKey   string
	ReadabilityBackend  string
	EmbedlyAppKey       string
	EnforceRedirect     bool
	AvatarURL           string
	SecretKey           string
	ORCAVerifyCode      string
	IsProMode           bool
	ActiveCodeLives     int
	ResetPwdCodeLives   int
	CategoryHideOnHome  int
	DateFormat          string
	DateTimeFormat      string
	DateTimeShortFormat string
	TimeZone            string
	RealtimeRenderMD    bool
	ImageSizeSmall      int
	ImageSizeMiddle     int
	ImageLinkAlphabets  []byte
	ImageXSend          bool
	ImageXSendHeader    string
	Langs               []string

	LoginRememberDays int
	LoginMaxRetries   int
	LoginFailedBlocks int

	CookieRememberName string
	CookieUserName     string

	// search
	SearchEnabled bool
	NativeSearch  bool

	// sphinx search setting
	SphinxEnabled bool
	SphinxHost    string
	SphinxIndex   string
	SphinxMaxConn int

	// mail setting
	MailUser     string
	MailFrom     string
	MailHost     string
	MailAuthUser string
	MailAuthPass string

	// ads setting
	Ads AdRecords

	// contact settings
	Contacts ContactRecords

	// memcached setting
	MemcachedEnabled bool
	MemcachedConn    string

	// redis setting
	RedisEnabled bool
	RedisConn    string

	// pay setting
	AlipayPartnerId   string
	AlipaySignKey     string
	AlipaySellerEmail string
	AlipaySellerId    string
)
View Source
var (
	// OAuth
	GithubClientId       string
	GithubClientSecret   string
	GoogleClientId       string
	GoogleClientSecret   string
	WeiboClientId        string
	WeiboClientSecret    string
	QQClientId           string
	QQClientSecret       string
	TwitterClientId      string
	TwitterClientSecret  string
	FacebookClientId     string
	FacebookClientSecret string
	FanfouClientId       string
	FanfouClientSecret   string
	SohuClientId         string
	SohuClientSecret     string
	NeteaseClientId      string
	NeteaseClientSecret  string
)
View Source
var (
	// Social Auth
	GithubAuth *apps.Github
	GoogleAuth *apps.Google
	SocialAuth *social.SocialAuth
)
View Source
var (
	Cfg     *goconfig.ConfigFile
	Cache   cache.Cache
	Captcha *captcha.Captcha
)
View Source
var (
	GlobalConfPath   = "conf/global/app.ini"
	AppConfPath      = "conf/app.ini"
	CompressConfPath = "conf/compress.json"
	AdsConfPath      = "conf/ads.xml"
	ContactsConfPath = "conf/contact.xml"
)

Functions

func IsMatchHost

func IsMatchHost(uri string) bool

func LoadAds

func LoadAds()

func LoadConfig

func LoadConfig() *goconfig.ConfigFile

LoadConfig loads configuration file.

func LoadContacts

func LoadContacts()

Types

type AdRecord

type AdRecord struct {
	XMLName xml.Name `xml:"ad"`
	Url     string   `xml:"url"`
	Img     []string `xml:"img"`
	Title   string   `xml:"description"`
}

type AdRecords

type AdRecords struct {
	XMLName xml.Name   `xml:"yiiliads"`
	Records []AdRecord `xml:"ad"`
}

type ContactRecord

type ContactRecord struct {
	XMLName     xml.Name `xml:"item"`
	Url         string   `xml:"url"`
	Icon        string   `xml:"icon"`
	Qrcode      string   `xml:"qrcode"`
	Title       string   `xml:"title"`
	Description string   `xml:"description"`
}

type ContactRecords

type ContactRecords struct {
	XMLName xml.Name        `xml:"contact"`
	Records []ContactRecord `xml:"item"`
}

Jump to

Keyboard shortcuts

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