Documentation ¶
Index ¶
- Variables
- func Errors() gin.HandlerFunc
- func Init() (err error)
- func NeedLogin() gin.HandlerFunc
- type APIHandler
- func (h *APIHandler) DefaultLoginInfo(c *gin.Context)
- func (h *APIHandler) GetServerInfo(c *gin.Context)
- func (h *APIHandler) Login(c *gin.Context)
- func (h *APIHandler) Logout(c *gin.Context)
- func (h *APIHandler) ModifyPassword(c *gin.Context)
- func (h *APIHandler) Players(c *gin.Context)
- func (h *APIHandler) Pushers(c *gin.Context)
- func (h *APIHandler) RecordFiles(c *gin.Context)
- func (h *APIHandler) RecordFolders(c *gin.Context)
- func (h *APIHandler) Restart(c *gin.Context)
- func (h *APIHandler) StreamStart(c *gin.Context)
- func (h *APIHandler) StreamStop(c *gin.Context)
- func (h *APIHandler) UserInfo(c *gin.Context)
- type CountData
- type DiskData
- type PercentData
Constants ¶
This section is empty.
Variables ¶
View Source
var API = &APIHandler{ RestartChan: make(chan bool), }
View Source
var BuildDateTime = ""
View Source
var BuildVersion = "v8.1"
View Source
var Router *gin.Engine
Functions ¶
func Errors ¶
func Errors() gin.HandlerFunc
func NeedLogin ¶
func NeedLogin() gin.HandlerFunc
Types ¶
type APIHandler ¶
type APIHandler struct {
RestartChan chan bool
}
func (*APIHandler) DefaultLoginInfo ¶
func (h *APIHandler) DefaultLoginInfo(c *gin.Context)
func (*APIHandler) GetServerInfo ¶
func (h *APIHandler) GetServerInfo(c *gin.Context)
*
- @api {get} /api/v1/getserverinfo 获取平台运行信息
- @apiGroup sys
- @apiName GetServerInfo
- @apiSuccess (200) {String} Hardware 硬件信息
- @apiSuccess (200) {String} RunningTime 运行时间
- @apiSuccess (200) {String} StartUpTime 启动时间
- @apiSuccess (200) {String} Server 软件信息
func (*APIHandler) Login ¶
func (h *APIHandler) Login(c *gin.Context)
*
- @api {get} /api/v1/login 登录
- @apiGroup sys
- @apiName Login
- @apiParam {String} username 用户名
- @apiParam {String} password 密码(经过md5加密,32位长度,不带中划线,不区分大小写)
- @apiSuccessExample 成功
- HTTP/1.1 200 OK
- Set-Cookie: token=s%3ArkyMbQE0M.5AKAOXbW8c7iP%2BOo0venPkCYiEiPK9FY31mB6AlFQak;//用着后续接口调用的 token
func (*APIHandler) Logout ¶
func (h *APIHandler) Logout(c *gin.Context)
*
- @api {get} /api/v1/logout 登出
- @apiGroup sys
- @apiName Logout
- @apiUse simpleSuccess
func (*APIHandler) ModifyPassword ¶
func (h *APIHandler) ModifyPassword(c *gin.Context)
func (*APIHandler) Players ¶
func (h *APIHandler) Players(c *gin.Context)
*
- @api {get} /api/v1/players 获取拉流列表
- @apiGroup stats
- @apiName Players
- @apiParam {Number} [start] 分页开始,从零开始
- @apiParam {Number} [limit] 分页大小
- @apiParam {String} sort 排序字段
- @apiParam {String=ascending,descending} [order] 排序顺序
- @apiParam {String} [q] 查询参数
- @apiSuccess (200) {Number} total 总数
- @apiSuccess (200) {Array} rows 推流列表
- @apiSuccess (200) {String} rows.id
- @apiSuccess (200) {String} rows.path
- @apiSuccess (200) {String} rows.transType 传输模式
- @apiSuccess (200) {Number} rows.inBytes 入口流量
- @apiSuccess (200) {Number} rows.outBytes 出口流量
- @apiSuccess (200) {String} rows.startAt 开始时间
func (*APIHandler) Pushers ¶
func (h *APIHandler) Pushers(c *gin.Context)
*
- @api {get} /api/v1/pushers 获取推流列表
- @apiGroup stats
- @apiName Pushers
- @apiParam {Number} [start] 分页开始,从零开始
- @apiParam {Number} [limit] 分页大小
- @apiParam {String} sort 排序字段
- @apiParam {String=ascending,descending} [order] 排序顺序
- @apiParam {String} [q] 查询参数
- @apiSuccess (200) {Number} total 总数
- @apiSuccess (200) {Array} rows 推流列表
- @apiSuccess (200) {String} rows.id
- @apiSuccess (200) {String} rows.path
- @apiSuccess (200) {String} rows.transType 传输模式
- @apiSuccess (200) {Number} rows.inBytes 入口流量
- @apiSuccess (200) {Number} rows.outBytes 出口流量
- @apiSuccess (200) {String} rows.startAt 开始时间
- @apiSuccess (200) {Number} rows.onlines 在线人数
func (*APIHandler) RecordFiles ¶
func (h *APIHandler) RecordFiles(c *gin.Context)
*
- @api {get} /api/v1/record/files 获取所有录像文件
- @apiGroup record
- @apiName RecordFiles
- @apiParam {Number} folder 录像文件所在的文件夹
- @apiParam {Number} [start] 分页开始,从零开始
- @apiParam {Number} [limit] 分页大小
- @apiParam {String} sort 排序字段
- @apiParam {String=ascending,descending} [order] 排序顺序
- @apiParam {String} [q] 查询参数
- @apiSuccess (200) {Number} total 总数
- @apiSuccess (200) {Array} rows 文件列表
- @apiSuccess (200) {String} rows.duration 格式化好的录像时长
- @apiSuccess (200) {Number} rows.durationMillis 录像时长,毫秒为单位
- @apiSuccess (200) {String} rows.path 录像文件的相对路径,录像文件为m3u8格式,将其放到video标签中便可直接播放。其绝对路径为:http[s]://host:port/record/path。
func (*APIHandler) RecordFolders ¶
func (h *APIHandler) RecordFolders(c *gin.Context)
*
- @api {get} /api/v1/record/folders 获取所有录像文件夹
- @apiGroup record
- @apiName RecordFolders
- @apiParam {Number} [start] 分页开始,从零开始
- @apiParam {Number} [limit] 分页大小
- @apiParam {String} sort 排序字段
- @apiParam {String=ascending,descending} [order] 排序顺序
- @apiParam {String} [q] 查询参数
- @apiSuccess (200) {Number} total 总数
- @apiSuccess (200) {Array} rows 文件夹列表
- @apiSuccess (200) {String} rows.folder 录像文件夹名称
func (*APIHandler) Restart ¶
func (h *APIHandler) Restart(c *gin.Context)
*
- @api {get} /api/v1/restart 重启服务
- @apiGroup sys
- @apiName Restart
- @apiUse simpleSuccess
func (*APIHandler) StreamStart ¶
func (h *APIHandler) StreamStart(c *gin.Context)
*
- @api {get} /api/v1/stream/start 启动拉转推
- @apiGroup stream
- @apiName StreamStart
- @apiParam {String} url RTSP源地址
- @apiParam {String} [customPath] 转推时的推送PATH
- @apiParam {String=TCP,UDP} [transType=TCP] 拉流传输模式
- @apiParam {Number} [idleTimeout] 拉流时的超时时间
- @apiParam {Number} [heartbeatInterval] 拉流时的心跳间隔,毫秒为单位。如果心跳间隔不为0,那拉流时会向源地址以该间隔发送OPTION请求用来心跳保活
- @apiSuccess (200) {String} ID 拉流的ID。后续可以通过该ID来停止拉流
func (*APIHandler) StreamStop ¶
func (h *APIHandler) StreamStop(c *gin.Context)
*
- @api {get} /api/v1/stream/stop 停止推流
- @apiGroup stream
- @apiName StreamStop
- @apiParam {String} id 拉流的ID
- @apiUse simpleSuccess
func (*APIHandler) UserInfo ¶
func (h *APIHandler) UserInfo(c *gin.Context)
*
- @api {get} /api/v1/userInfo 获取当前登录用户信息
- @apiGroup sys
- @apiName UserInfo
- @apiUse userInfo
type PercentData ¶
Click to show internal directories.
Click to hide internal directories.