site

package
v0.0.0-...-84e4fc3 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromID

func FromID(siteid string) *domain.Site

FromID SiteFromID

func IntelliDuration

func IntelliDuration(seconds int64) string

IntelliDuration 智能显示时间间隔

func IntelliTime

func IntelliTime(t time.Time) string

IntelliTime 智能显示时间

func OnlineStateChan

func OnlineStateChan() *(chan *Context)

OnlineStateChan 在线状态管道

func RemoveSiteCache

func RemoveSiteCache(host string)

RemoveSiteCache 清除SiteCache

func RenderAt

func RenderAt(text string) string

RenderAt 渲染表情

func RenderFace

func RenderFace(text string) string

RenderFace 渲染表情

func RenderPageWithContext

func RenderPageWithContext(text template.HTML, site *Context) template.HTML

RenderPageWithContext 在上下文渲染页面

func RenderUBB

func RenderUBB(text string) string

RenderUBB 渲染UBB

func ThreadContent

func ThreadContent(text string) string

ThreadContent 帖子内容

Types

type BaseRender

type BaseRender struct {
	Type string
	Args []string
	Site *domain.Site
}

BaseRender 基础UBB渲染器

type Context

type Context struct {
	Host       string
	RequestURI string
	UserAgent  string
	ClientIP   string
	Site       *domain.Site
	MainSite   *domain.Site
	Session    *domain.Session
}

Context 站点上下文

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine 站点引擎

func DefaultEngine

func DefaultEngine() *Engine

DefaultEngine 默认站点引擎

func (*Engine) DELETE

func (r *Engine) DELETE(relativePath string, handler RequestHandler)

DELETE DELETE

func (*Engine) GET

func (r *Engine) GET(relativePath string, handler RequestHandler)

GET GET

func (*Engine) GETPage

func (r *Engine) GETPage(relativePath string, handler PageRequestHandler)

GETPage GETPage

func (*Engine) GenericGET

func (r *Engine) GenericGET(relativePath string, handler GetRequestHandler)

GenericGET GenericGET

func (*Engine) PATCH

func (r *Engine) PATCH(relativePath string, handler RequestHandler)

PATCH PATCH

func (*Engine) POST

func (r *Engine) POST(relativePath string, handler RequestHandler)

POST POST

func (*Engine) PUT

func (r *Engine) PUT(relativePath string, handler RequestHandler)

PUT PUT

func (*Engine) Run

func (r *Engine) Run(addr ...string) (err error)

Run 启动引擎

type GetRequestHandler

type GetRequestHandler func(c *gin.Context, siteCtx *Context)

GetRequestHandler 站点请求处理器

type PageRequestHandler

type PageRequestHandler func(c *gin.Context, siteCtx *Context) (string, interface{}, error)

PageRequestHandler 站点请求处理器

type RequestHandler

type RequestHandler func(c *gin.Context, siteCtx *Context) (interface{}, error)

RequestHandler 站点请求处理器

type ThreadsRender

type ThreadsRender struct {
	BaseRender
}

ThreadsRender 主题列表渲染器

func (*ThreadsRender) Render

func (t *ThreadsRender) Render(raw string) string

Render 渲染UUB

type UBBRender

type UBBRender interface {
	Render(raw string) string
}

UBBRender UBB渲染器

func NewRender

func NewRender(t, args string, site *domain.Site) (UBBRender, error)

NewRender 新render

Jump to

Keyboard shortcuts

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