Documentation ¶
Index ¶
- type AnalyticsController
- type BaseController
- type BatchController
- type ClassesController
- func (c *ClassesController) Delete()
- func (c *ClassesController) Get()
- func (c *ClassesController) HandleCreate()
- func (c *ClassesController) HandleDelete()
- func (c *ClassesController) HandleFind()
- func (c *ClassesController) HandleGet()
- func (c *ClassesController) HandleUpdate()
- func (c *ClassesController) Post()
- func (c *ClassesController) Put()
- type CloudCodeController
- type ErrorController
- type FeaturesController
- type FilesController
- type FunctionsController
- type GlobalConfigController
- type HealthController
- type HooksController
- func (h *HooksController) Delete()
- func (h *HooksController) Get()
- func (h *HooksController) HandleCreateFunction()
- func (h *HooksController) HandleCreateTrigger()
- func (h *HooksController) HandleGetAllFunctions()
- func (h *HooksController) HandleGetAllTriggers()
- func (h *HooksController) HandleGetFunction()
- func (h *HooksController) HandleGetTrigger()
- func (h *HooksController) HandleUpdateFunction()
- func (h *HooksController) HandleUpdateTrigger()
- func (h *HooksController) Post()
- func (h *HooksController) Prepare()
- func (h *HooksController) Put()
- type IAPValidationController
- type InstallationsController
- func (i *InstallationsController) Delete()
- func (i *InstallationsController) HandleCreate()
- func (i *InstallationsController) HandleDelete()
- func (i *InstallationsController) HandleFind()
- func (i *InstallationsController) HandleGet()
- func (i *InstallationsController) HandleUpdate()
- func (i *InstallationsController) Put()
- type JobsController
- type LoginController
- type LogoutController
- type LogsController
- type PublicController
- func (p *PublicController) ChangePassword()
- func (p *PublicController) InvalidLink()
- func (p *PublicController) InvalidVerificationLink()
- func (p *PublicController) LinkSendFail()
- func (p *PublicController) LinkSendSuccess()
- func (p *PublicController) PasswordResetSuccess()
- func (p *PublicController) RequestResetPassword()
- func (p *PublicController) ResendVerificationEmail()
- func (p *PublicController) ResetPassword()
- func (p *PublicController) VerifyEmail()
- func (p *PublicController) VerifyEmailSuccess()
- type PurgeController
- type PushController
- type RequestInfo
- type ResetController
- type RolesController
- type SchemasController
- func (s *SchemasController) Delete()
- func (s *SchemasController) HandleCreate()
- func (s *SchemasController) HandleDelete()
- func (s *SchemasController) HandleFind()
- func (s *SchemasController) HandleGet()
- func (s *SchemasController) HandleUpdate()
- func (s *SchemasController) Prepare()
- func (s *SchemasController) Put()
- type SessionsController
- func (s *SessionsController) Delete()
- func (s *SessionsController) HandleCreate()
- func (s *SessionsController) HandleDelete()
- func (s *SessionsController) HandleFind()
- func (s *SessionsController) HandleGet()
- func (s *SessionsController) HandleGetMe()
- func (s *SessionsController) HandleUpdate()
- func (s *SessionsController) HandleUpdateMe()
- func (s *SessionsController) Put()
- type UpgradeSessionController
- type UsersController
- func (u *UsersController) Delete()
- func (u *UsersController) HandleCreate()
- func (u *UsersController) HandleDelete()
- func (u *UsersController) HandleFind()
- func (u *UsersController) HandleGet()
- func (u *UsersController) HandleMe()
- func (u *UsersController) HandleUpdate()
- func (u *UsersController) Put()
- type VerificationController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalyticsController ¶
type AnalyticsController struct {
ClassesController
}
AnalyticsController ...
func (*AnalyticsController) AppOpened ¶
func (a *AnalyticsController) AppOpened()
AppOpened ... @router /AppOpened [post]
func (*AnalyticsController) Delete ¶
func (a *AnalyticsController) Delete()
Delete ... @router / [delete]
func (*AnalyticsController) HandleEvent ¶
func (a *AnalyticsController) HandleEvent()
HandleEvent ... @router /:eventName [post]
type BaseController ¶
type BaseController struct { beego.Controller Info *RequestInfo Auth *rest.Auth Query map[string]string JSONBody types.M RawBody []byte }
BaseController ... Info 当前请求的权限信息 Auth 当前请求的用户权限 JSONBody 由 JSON 格式转换来的请求数据 RawBody 原始请求数据
func (*BaseController) EnforceMasterKeyAccess ¶
func (b *BaseController) EnforceMasterKeyAccess() bool
EnforceMasterKeyAccess 接口需要 Master 权限 返回 true 表示当前请求是 Master 权限
func (*BaseController) HandleError ¶
func (b *BaseController) HandleError(err error, status int)
HandleError 返回错误信息,不指定 status 参数时,默认为 0
func (*BaseController) InvalidRequest ¶
func (b *BaseController) InvalidRequest()
InvalidRequest 无效请求
func (*BaseController) Prepare ¶
func (b *BaseController) Prepare()
Prepare 对请求权限进行处理 1. 从请求头中获取各种 key 2. 尝试按 json 格式转换 body 3. 尝试从 body 中获取各种 key 4. 校验请求权限 5. 生成用户信息
type BatchController ¶
type BatchController struct {
ClassesController
}
BatchController ...
func (*BatchController) HandleBatch ¶
func (b *BatchController) HandleBatch()
HandleBatch ... @router / [post]
func (*BatchController) HandleRequest ¶
HandleRequest ...
type ClassesController ¶
type ClassesController struct { BaseController ClassName string ObjectID string }
ClassesController 对象操作 API 的基础结构 处理 /classes 接口的所有请求,处理内部类的部分请求 ClassName 要操作的类名 ObjectID 要操作的对象 id
func (*ClassesController) Delete ¶
func (c *ClassesController) Delete()
Delete ... @router / [delete]
func (*ClassesController) HandleCreate ¶
func (c *ClassesController) HandleCreate()
HandleCreate 处理对象创建请求,返回对象 id 与对象位置 @router /:className [post]
func (*ClassesController) HandleDelete ¶
func (c *ClassesController) HandleDelete()
HandleDelete 处理删除指定对象请求 @router /:className/:objectId [delete]
func (*ClassesController) HandleFind ¶
func (c *ClassesController) HandleFind()
HandleFind 处理查找对象请求 @router /:className [get]
func (*ClassesController) HandleGet ¶
func (c *ClassesController) HandleGet()
HandleGet 处理查询指定对象请求,返回查询到的对象 @router /:className/:objectId [get]
func (*ClassesController) HandleUpdate ¶
func (c *ClassesController) HandleUpdate()
HandleUpdate 处理更新指定对象请求 @router /:className/:objectId [put]
type CloudCodeController ¶
type CloudCodeController struct {
ClassesController
}
CloudCodeController ...
func (*CloudCodeController) Delete ¶
func (c *CloudCodeController) Delete()
Delete ... @router / [delete]
func (*CloudCodeController) HandleGet ¶
func (c *CloudCodeController) HandleGet()
HandleGet ... @router /jobs [get]
type FeaturesController ¶
type FeaturesController struct {
ClassesController
}
FeaturesController ...
func (*FeaturesController) Delete ¶
func (f *FeaturesController) Delete()
Delete ... @router / [delete]
func (*FeaturesController) HandleGet ¶
func (f *FeaturesController) HandleGet()
HandleGet ... @router / [get]
type FilesController ¶
type FilesController struct {
ClassesController
}
FilesController 处理 /files 接口的请求
func (*FilesController) HandleCreate ¶
func (f *FilesController) HandleCreate()
HandleCreate 处理上传文件请求 @router /:filename [post]
func (*FilesController) HandleDelete ¶
func (f *FilesController) HandleDelete()
HandleDelete 处理删除文件请求 @router /:filename [delete]
func (*FilesController) HandleGet ¶
func (f *FilesController) HandleGet()
HandleGet 处理下载文件请求 @router /:appId/:filename [get]
type FunctionsController ¶
type FunctionsController struct {
ClassesController
}
FunctionsController 处理 /functions 接口的请求
func (*FunctionsController) Delete ¶
func (f *FunctionsController) Delete()
Delete ... @router / [delete]
func (*FunctionsController) HandleCloudFunction ¶
func (f *FunctionsController) HandleCloudFunction()
HandleCloudFunction 执行指定的云函数 返回数据格式如下:
{ "result":"func res" }
@router /:functionName [post]
type GlobalConfigController ¶
type GlobalConfigController struct {
ClassesController
}
GlobalConfigController 处理 /config 接口的请求
func (*GlobalConfigController) Delete ¶
func (g *GlobalConfigController) Delete()
Delete ... @router / [delete]
func (*GlobalConfigController) HandleGet ¶
func (g *GlobalConfigController) HandleGet()
HandleGet 获取配置信息 @router / [get]
func (*GlobalConfigController) HandlePut ¶
func (g *GlobalConfigController) HandlePut()
HandlePut 修改配置信息 @router / [put]
func (*GlobalConfigController) Post ¶
func (g *GlobalConfigController) Post()
Post ... @router / [post]
type HealthController ¶
type HealthController struct {
beego.Controller
}
HealthController 检测服务器健康状态
type HooksController ¶
type HooksController struct {
ClassesController
}
HooksController ...
func (*HooksController) HandleCreateFunction ¶
func (h *HooksController) HandleCreateFunction()
HandleCreateFunction ... @router /functions [post]
func (*HooksController) HandleCreateTrigger ¶
func (h *HooksController) HandleCreateTrigger()
HandleCreateTrigger ... @router /triggers [post]
func (*HooksController) HandleGetAllFunctions ¶
func (h *HooksController) HandleGetAllFunctions()
HandleGetAllFunctions ... @router /functions [get]
func (*HooksController) HandleGetAllTriggers ¶
func (h *HooksController) HandleGetAllTriggers()
HandleGetAllTriggers ... @router /triggers [get]
func (*HooksController) HandleGetFunction ¶
func (h *HooksController) HandleGetFunction()
HandleGetFunction ... @router /functions/:functionName [get]
func (*HooksController) HandleGetTrigger ¶
func (h *HooksController) HandleGetTrigger()
HandleGetTrigger ... @router /triggers/:className/:triggerName [get]
func (*HooksController) HandleUpdateFunction ¶
func (h *HooksController) HandleUpdateFunction()
HandleUpdateFunction ... @router /functions/:functionName [put]
func (*HooksController) HandleUpdateTrigger ¶
func (h *HooksController) HandleUpdateTrigger()
HandleUpdateTrigger ... @router /triggers/:className/:triggerName [put]
type IAPValidationController ¶
type IAPValidationController struct {
ClassesController
}
IAPValidationController ...
func (*IAPValidationController) Delete ¶
func (i *IAPValidationController) Delete()
Delete ... @router / [delete]
func (*IAPValidationController) Get ¶
func (i *IAPValidationController) Get()
Get ... @router / [get]
func (*IAPValidationController) HandlePost ¶
func (i *IAPValidationController) HandlePost()
HandlePost ... @router / [post]
func (*IAPValidationController) Put ¶
func (i *IAPValidationController) Put()
Put ... @router / [put]
type InstallationsController ¶
type InstallationsController struct {
ClassesController
}
InstallationsController 处理 /installations 接口的请求
func (*InstallationsController) Delete ¶
func (i *InstallationsController) Delete()
Delete ... @router / [delete]
func (*InstallationsController) HandleCreate ¶
func (i *InstallationsController) HandleCreate()
HandleCreate 处理添加设备请求 @router / [post]
func (*InstallationsController) HandleDelete ¶
func (i *InstallationsController) HandleDelete()
HandleDelete 处理删除指定设备请求 @router /:objectId [delete]
func (*InstallationsController) HandleFind ¶
func (i *InstallationsController) HandleFind()
HandleFind 处理查找已安装设备请求 @router / [get]
func (*InstallationsController) HandleGet ¶
func (i *InstallationsController) HandleGet()
HandleGet 处理获取指定设备信息请求 @router /:objectId [get]
func (*InstallationsController) HandleUpdate ¶
func (i *InstallationsController) HandleUpdate()
HandleUpdate 处理更新设备信息请求 @router /:objectId [put]
func (*InstallationsController) Put ¶
func (i *InstallationsController) Put()
Put ... @router / [put]
type JobsController ¶
type JobsController struct {
ClassesController
}
JobsController 处理 /jobs 接口的请求
func (*JobsController) HandleCloudJob ¶
func (j *JobsController) HandleCloudJob()
HandleCloudJob 执行后台任务 @router /:jobName [post]
func (*JobsController) HandlePost ¶
func (j *JobsController) HandlePost()
HandlePost ... @router / [post]
type LoginController ¶
type LoginController struct {
ClassesController
}
LoginController 处理 /login 接口的请求
func (*LoginController) HandleLogIn ¶
func (l *LoginController) HandleLogIn()
HandleLogIn 处理登录请求 @router / [get]
type LogoutController ¶
type LogoutController struct {
ClassesController
}
LogoutController 处理 /logout 接口的请求
func (*LogoutController) HandleLogOut ¶
func (l *LogoutController) HandleLogOut()
HandleLogOut 处理用户退出请求 @router / [post]
type LogsController ¶
type LogsController struct {
ClassesController
}
LogsController ...
func (*LogsController) HandleGet ¶
func (l *LogsController) HandleGet()
HandleGet ... @router / [get]
type PublicController ¶
type PublicController struct {
beego.Controller
}
PublicController 处理密码修改与邮箱验证请求
func (*PublicController) ChangePassword ¶
func (p *PublicController) ChangePassword()
ChangePassword 修改密码页面 @router /choose_password [get]
func (*PublicController) InvalidLink ¶
func (p *PublicController) InvalidLink()
InvalidLink 无效链接页面 @router /invalid_link [get]
func (*PublicController) InvalidVerificationLink ¶
func (p *PublicController) InvalidVerificationLink()
InvalidVerificationLink 无效验证链接页面 @router /invalid_verification_link [get]
func (*PublicController) LinkSendFail ¶
func (p *PublicController) LinkSendFail()
LinkSendFail 发送失败页面 @router /link_send_fail [get]
func (*PublicController) LinkSendSuccess ¶
func (p *PublicController) LinkSendSuccess()
LinkSendSuccess 发送成功页面 @router /link_send_success [get]
func (*PublicController) PasswordResetSuccess ¶
func (p *PublicController) PasswordResetSuccess()
PasswordResetSuccess 密码重置成功页面 @router /password_reset_success [get]
func (*PublicController) RequestResetPassword ¶
func (p *PublicController) RequestResetPassword()
RequestResetPassword 处理重置密码请求 该接口从重置密码邮件内部发起请求,见 rest.SendPasswordResetEmail() @router /request_password_reset [get]
func (*PublicController) ResendVerificationEmail ¶
func (p *PublicController) ResendVerificationEmail()
ResendVerificationEmail 处理重新发送验证邮件请求 @router /resend_verification_email [post]
func (*PublicController) ResetPassword ¶
func (p *PublicController) ResetPassword()
ResetPassword 处理实际的重置密码请求 @router /request_password_reset [post]
func (*PublicController) VerifyEmail ¶
func (p *PublicController) VerifyEmail()
VerifyEmail 处理验证邮箱请求 该接口从验证邮件内部发起请求,见 rest.SendVerificationEmail() @router /verify_email [get]
func (*PublicController) VerifyEmailSuccess ¶
func (p *PublicController) VerifyEmailSuccess()
VerifyEmailSuccess 验证邮箱成功页面 @router /verify_email_success [get]
type PurgeController ¶
type PurgeController struct {
ClassesController
}
PurgeController 处理 /purge 接口的请求
func (*PurgeController) HandleDelete ¶
func (p *PurgeController) HandleDelete()
HandleDelete 处理删除指定类数据请求 @router /:className [delete]
type PushController ¶
type PushController struct {
ClassesController
}
PushController 处理 /push 接口的请求
func (*PushController) HandlePost ¶
func (p *PushController) HandlePost()
HandlePost 处理发送推送消息请求 @router / [post]
type RequestInfo ¶
type RequestInfo struct { AppID string MasterKey string ClientKey string JavaScriptKey string DotNetKey string RestAPIKey string SessionToken string InstallationID string ClientVersion string ClientSDK map[string]string }
RequestInfo http 请求的权限信息
type ResetController ¶
type ResetController struct {
ClassesController
}
ResetController 处理 /requestPasswordReset 接口的请求
func (*ResetController) HandleResetRequest ¶
func (r *ResetController) HandleResetRequest()
HandleResetRequest 处理通过 email 重置密码的请求 @router / [post]
type RolesController ¶
type RolesController struct {
ClassesController
}
RolesController 处理 /roles 接口的请求
func (*RolesController) HandleCreate ¶
func (r *RolesController) HandleCreate()
HandleCreate 处理创建 role 请求 @router / [post]
func (*RolesController) HandleDelete ¶
func (r *RolesController) HandleDelete()
HandleDelete 处理删除指定 role 请求 @router /:objectId [delete]
func (*RolesController) HandleFind ¶
func (r *RolesController) HandleFind()
HandleFind 处理查找 role 请求 @router / [get]
func (*RolesController) HandleGet ¶
func (r *RolesController) HandleGet()
HandleGet 处理获取指定 role 请求 @router /:objectId [get]
func (*RolesController) HandleUpdate ¶
func (r *RolesController) HandleUpdate()
HandleUpdate 处理更新指定 role 请求 @router /:objectId [put]
type SchemasController ¶
type SchemasController struct {
ClassesController
}
SchemasController 处理 /schemas 接口的请求
func (*SchemasController) Delete ¶
func (s *SchemasController) Delete()
Delete ... @router / [delete]
func (*SchemasController) HandleCreate ¶
func (s *SchemasController) HandleCreate()
HandleCreate 处理创建类请求,同时可匹配 / 的 POST 请求 @router /:className [post]
func (*SchemasController) HandleDelete ¶
func (s *SchemasController) HandleDelete()
HandleDelete 处理删除指定类请求 @router /:className [delete]
func (*SchemasController) HandleFind ¶
func (s *SchemasController) HandleFind()
HandleFind 处理 schema 查找请求 @router / [get]
func (*SchemasController) HandleGet ¶
func (s *SchemasController) HandleGet()
HandleGet 处理查找指定的类请求 @router /:className [get]
func (*SchemasController) HandleUpdate ¶
func (s *SchemasController) HandleUpdate()
HandleUpdate 处理更新类请求 @router /:className [put]
func (*SchemasController) Prepare ¶
func (s *SchemasController) Prepare()
Prepare 访问 /schemas 接口需要 master key
type SessionsController ¶
type SessionsController struct {
ClassesController
}
SessionsController 处理 /sessions 接口的请求
func (*SessionsController) Delete ¶
func (s *SessionsController) Delete()
Delete ... @router / [delete]
func (*SessionsController) HandleCreate ¶
func (s *SessionsController) HandleCreate()
HandleCreate 处理 session 创建请求 @router / [post]
func (*SessionsController) HandleDelete ¶
func (s *SessionsController) HandleDelete()
HandleDelete 处理删除指定 session 请求 @router /:objectId [delete]
func (*SessionsController) HandleFind ¶
func (s *SessionsController) HandleFind()
HandleFind 处理查找 session 请求 @router / [get]
func (*SessionsController) HandleGet ¶
func (s *SessionsController) HandleGet()
HandleGet 处理获取指定 session 请求 @router /:objectId [get]
func (*SessionsController) HandleGetMe ¶
func (s *SessionsController) HandleGetMe()
HandleGetMe 处理当前请求 session @router /me [get]
func (*SessionsController) HandleUpdate ¶
func (s *SessionsController) HandleUpdate()
HandleUpdate 处理更新指定 session 请求 @router /:objectId [put]
func (*SessionsController) HandleUpdateMe ¶
func (s *SessionsController) HandleUpdateMe()
HandleUpdateMe 仅用于更新 installationId @router /me [put]
type UpgradeSessionController ¶
type UpgradeSessionController struct {
ClassesController
}
UpgradeSessionController 处理 /upgradeToRevocableSession 接口的请求
func (*UpgradeSessionController) Delete ¶
func (u *UpgradeSessionController) Delete()
Delete ... @router / [delete]
func (*UpgradeSessionController) Get ¶
func (u *UpgradeSessionController) Get()
Get ... @router / [get]
func (*UpgradeSessionController) HandleUpdateToRevocableSession ¶
func (u *UpgradeSessionController) HandleUpdateToRevocableSession()
HandleUpdateToRevocableSession ... @router / [post]
func (*UpgradeSessionController) Put ¶
func (u *UpgradeSessionController) Put()
Put ... @router / [put]
type UsersController ¶
type UsersController struct {
ClassesController
}
UsersController 处理 /users 接口的请求
func (*UsersController) HandleCreate ¶
func (u *UsersController) HandleCreate()
HandleCreate 处理创建用户请求 @router / [post]
func (*UsersController) HandleDelete ¶
func (u *UsersController) HandleDelete()
HandleDelete 处理删除用户请求 过滤对 /me 接口的 delete 请求 @router /:objectId [delete]
func (*UsersController) HandleFind ¶
func (u *UsersController) HandleFind()
HandleFind 处理查找用户请求 @router / [get]
func (*UsersController) HandleGet ¶
func (u *UsersController) HandleGet()
HandleGet 处理查找指定用户请求 @router /:objectId [get]
func (*UsersController) HandleMe ¶
func (u *UsersController) HandleMe()
HandleMe 处理获取当前用户信息的请求 @router /me [get]
func (*UsersController) HandleUpdate ¶
func (u *UsersController) HandleUpdate()
HandleUpdate 处理更新用户信息请求 过滤对 /me 接口的 put 请求 @router /:objectId [put]
type VerificationController ¶
type VerificationController struct {
ClassesController
}
VerificationController 处理 /verificationEmailRequest 接口的请求
func (*VerificationController) Delete ¶
func (r *VerificationController) Delete()
Delete ... @router / [delete]
func (*VerificationController) HandleVerificationEmailRequest ¶
func (r *VerificationController) HandleVerificationEmailRequest()
HandleVerificationEmailRequest 处理 email 验证的请求 @router / [post]
Source Files ¶
- IAPvalidation.go
- analytics.go
- base.go
- batch.go
- classes.go
- cloudcode.go
- error.go
- features.go
- files.go
- functions.go
- globalconfig.go
- health.go
- hooks.go
- installations.go
- jobs.go
- login.go
- logout.go
- logs.go
- public.go
- purge.go
- push.go
- reset.go
- roles.go
- schemas.go
- sessions.go
- upgradesession.go
- users.go
- verification.go