controllers

package
v0.0.0-...-0eaedd4 Latest Latest
Warning

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

Go to latest
Published: May 9, 2017 License: MIT Imports: 19 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseController

type BaseController struct {
	beego.Controller
}

BaseController 基础控制器

func (*BaseController) BindVForm

func (bc *BaseController) BindVForm(obj interface{}) (err error)

BindVForm 绑定并验证表单数据

func (*BaseController) Error400

func (bc *BaseController) Error400(msgs ...string)

Error400 响应400错误码

func (*BaseController) Error500

func (bc *BaseController) Error500(msgs ...string)

Error500 响应500错误码

func (*BaseController) HTML

func (bc *BaseController) HTML(tplName string)

HTML 响应html渲染模板

func (*BaseController) JSON

func (bc *BaseController) JSON(v interface{})

JSON 响应json数据

type DownloadController

type DownloadController struct {
	BaseController
}

DownloadController 文件下载

func (*DownloadController) AddHistory

func (dc *DownloadController) AddHistory(fileType, fileSize int, fileName, fileLink string)

AddHistory 增加下载历史

func (*DownloadController) DoRequest

func (dc *DownloadController) DoRequest(u *url.URL) (resp *http.Response, err error)

DoRequest 请求数据

func (*DownloadController) DoResponse

func (dc *DownloadController) DoResponse(fileName string, fileLimit int64, resp *http.Response, header http.Header)

DoResponse 响应文件数据

type ErrorController

type ErrorController struct {
	BaseController
}

ErrorController 错误处理控制器

func (*ErrorController) Error400

func (ec *ErrorController) Error400()

Error400 400

func (*ErrorController) Error404

func (ec *ErrorController) Error404()

Error404 404

func (*ErrorController) Error500

func (ec *ErrorController) Error500()

Error500 500

type FileController

type FileController struct {
	DownloadController
}

FileController 文件下载控制器

func (*FileController) Post

func (fc *FileController) Post()

Post /file @router /download/file [post]

type MainController

type MainController struct {
	BaseController
}

MainController 入口控制器

func (*MainController) Captcha

func (mc *MainController) Captcha()

Captcha /captcha @router /captcha/:id.png [get]

func (*MainController) Get

func (mc *MainController) Get()

Get / @router / [get]

type SuggestController

type SuggestController struct {
	BaseController
}

SuggestController 反馈建议

func (*SuggestController) Get

func (sc *SuggestController) Get()

Get /suggest @router /suggest [get]

func (*SuggestController) Post

func (sc *SuggestController) Post()

Post /suggest @router /suggest [post]

type YVideoInfo

type YVideoInfo struct {
	Title   string
	Author  string
	URL     string
	Quality string
	Type    string
}

YVideoInfo youtube视频信息

type YoutubeController

type YoutubeController struct {
	DownloadController
}

YoutubeController youtube视频下载控制器

func (*YoutubeController) Post

func (yc *YoutubeController) Post()

Post /youtube @router /download/youtube [post]

Jump to

Keyboard shortcuts

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