Documentation ¶
Index ¶
- Constants
- Variables
- func StartBlogServer()
- type AppSvrConf
- type ArticleComments
- type Handlder
- func (self *Handlder) PBool(key string) bool
- func (self *Handlder) PEqInt(key string, value int) bool
- func (self *Handlder) PEqStr(key, value string) bool
- func (self *Handlder) PEqUInt(key string, value uint) bool
- func (self *Handlder) PInt(key string) int
- func (self *Handlder) PStr(key string) string
- func (self *Handlder) PUint(key string) uint
- func (self *Handlder) QBool(key string) bool
- func (self *Handlder) QEqInt(key string, value int) bool
- func (self *Handlder) QEqStr(key, value string) bool
- func (self *Handlder) QInt(key string) int
- func (self *Handlder) QStr(key string) string
- func (self *Handlder) Redirect(url string)
- type HandleFunc
- type MDB
- type PerType
- type QueryResultFunc
- type Route
- type TArticle
- type TArticleMsg
- type TCategory
- type TMessage
- type TRSSItem
- type TSessions
- type TStatistic
- type TitlesTop
- type User
Constants ¶
View Source
const ( APP_CONFIG_FILENAME = "app.conf" APP_DEFAULT_CONFIG = "app.default.conf" )
View Source
const ( Everyone PerType = 1 << 0 //访客 001 Authenticated = 1 << 1 //已登陆 010 AdministratorOnly = 1 << 2 //管理员 100 Administrator = AdministratorOnly | Authenticated //管理员也要已登陆 110 )
View Source
const ( BASEHTML = "base.html" ADMINHTML = "admin/base.html" )
两个基础模版
View Source
const INVALID_VALUE = 0xFFFFFFFF
Variables ¶
View Source
var ( // 能被上传的文件扩展名 IMAGES_EXT = []string{".jpg", ".jpeg", ".gif", ".png", ".bmp"} )
View Source
var QQwryData *qqwry.QQWry
全局 纯真ip数据库
Functions ¶
Types ¶
type AppSvrConf ¶
type AppSvrConf struct { Port int `json:"port"` DB string `json:"database"` SessionKey string `json:"sessionkey"` WebSite string `json:"website"` UploadPath string `json:"uploadpath"` }
定义可配置的服务器信息
type ArticleComments ¶
type Handlder ¶
type Handlder struct { http.ResponseWriter *http.Request HTMLFile string // 渲染的静态文件 StartTime time.Time DB *MDB //*sql.DB }
回调的参数类型
func NewHandler ¶
新建带有请求的handler,在这里可以启动数据库等等操作吧
type QueryResultFunc ¶
type Route ¶
type Route struct { URL string // 请求的url地址 HTMLFile string // 渲染的静态文件 Permission PerType // 权限 HandleFunc HandleFunc // 回调函数 }
路由结构体
type TArticle ¶
type TArticle struct { Id int Title string Author string CreateTime time.Time LastEditTime time.Time HTMLString string MarkdownString string Summary string CategoryId int CategoryName string IsPublic bool }
文章信息结构
type TArticleMsg ¶
type TSessions ¶
type TSessions struct {
// contains filtered or unexported fields
}
新建一个类型,继承sessions.CookieStore
Click to show internal directories.
Click to hide internal directories.