common

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ADMIN_ENV_KEY string = "BEAKERADMINPATH"
View Source
const CONFIG_NOT_FOUND int = 2
View Source
const Def_Database_MAX_IDLE_NUM = 20

数据库最大空闲数

View Source
const Def_Database_MAX_OPEN_NUM = 100

数据库最大连接数

View Source
const Def_Redis_EXPIRE_TIME = 3600

默认Redis过期时间

View Source
const Def_Website_INDEX_LIST_NUM = 10

默认首页显示记录数

View Source
const Def_Website_SITE_DES = "Beaker is a simple blog system."

默认网站描述

View Source
const Def_Website_SITE_FOOTER = "Beaker is a simple blog system."

默认footer内容

View Source
const Def_Website_SITE_NAME = "Beaker"

默认网站名称

View Source
const Def_Website_TWEET_NUM_ONE_PAGE = 10

默认tweet每页显示数

View Source
const DefaultEditor string = "nano"
View Source
const FAIL int = 1
View Source
const SERVER_ENV_KEY string = "BEAKERPATH"
View Source
const SERVER_PRIVATE_KEY = "pri.pem"
View Source
const SERVER_PUBLIC_KEY = "pub.pem"
View Source
const SUCC int = 99
View Source
const TAG_ARCHIVE string = "arc_"
View Source
const TAG_CAT string = "cat_"
View Source
const TAG_HOME string = "home_"
View Source
const TAG_NOTFOUND string = "404_"
View Source
const TAG_PAGE string = "pag_"
View Source
const TEMPLATE_ARCHIVE string = "post.jet"
View Source
const TEMPLATE_CAT string = "home.jet"
View Source
const TEMPLATE_HOME string = "home.jet"
View Source
const TEMPLATE_NotFound string = "404.jet"
View Source
const TEMPLATE_PAGE string = "post.jet"
View Source
const TEMPLATE_TWEET string = "tweet.jet"
View Source
const VERSION string = "v0.4.2"

Variables

This section is empty.

Functions

func Assert

func Assert(e error)

func Err

func Err(msg interface{})

Types

type ArticleModel

type ArticleModel struct {
	gorm.Model
	Catid   uint
	Title   string
	Content string
	Imgs    []ImgInfo `gorm:"-"`
}

type BaseReqMsg

type BaseReqMsg struct {
	Refresh bool
	Data    interface{}
}

type BaseRespMsg

type BaseRespMsg struct {
	Code int `json:"code"`
	Data interface{}
}

type CatModel

type CatModel struct {
	gorm.Model
	Name  string
	Alias string
}

type CatRmReq

type CatRmReq struct {
	BaseReqMsg
	ID    uint
	Name  string
	Alias string
	MvID  uint
}

type ImgInfo

type ImgInfo struct {
	Path   string
	Suffix string
	Md5    string
	Base64 string
	Readed bool
}

func (*ImgInfo) Read

func (imgInfo *ImgInfo) Read(parentPath string)

type LoginReq

type LoginReq struct {
	BaseReqMsg
	DK string
	UN string
	PW string
}

type LoginResp

type LoginResp struct {
	SuccMsgResp
}

type PageModel

type PageModel struct {
	gorm.Model
	Title   string
	Content string
	Imgs    []ImgInfo `gorm:"-"`
}

type SuccMsgResp

type SuccMsgResp struct {
	BaseRespMsg
	Msg string `json:"msg"`
}

type TweetListReq

type TweetListReq struct {
	BaseReqMsg
	CurPage uint
}

type TweetListResp

type TweetListResp struct {
	BaseRespMsg
	CurPage   uint
	TotlePage uint
	TweNum    uint
	List      []TweetModel
}

type TweetModel

type TweetModel struct {
	gorm.Model
	Content string
}

Jump to

Keyboard shortcuts

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