Documentation ¶
Index ¶
- func Authenticate(login string, password string) (user *models.User, err error)
- type APIBaseController
- type APISessionController
- type APISignalController
- type APISysloadController
- type BaseController
- type BreadCrumbs
- type CertificatesController
- type JSONResponse
- type KillParams
- type LoginController
- type LogsController
- type MainController
- type NestFinisher
- type NestPreparer
- type NewCertParams
- type OVConfigController
- type ProfileController
- type SettingsController
- type SignalParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIBaseController ¶
type APIBaseController struct {
BaseController
}
func (*APIBaseController) NestPrepare ¶
func (c *APIBaseController) NestPrepare()
func (*APIBaseController) Prepare ¶
func (c *APIBaseController) Prepare()
func (*APIBaseController) ServeJSONData ¶
func (c *APIBaseController) ServeJSONData(data interface{})
func (*APIBaseController) ServeJSONError ¶
func (c *APIBaseController) ServeJSONError(message string)
func (*APIBaseController) ServeJSONMessage ¶
func (c *APIBaseController) ServeJSONMessage(message string)
type APISessionController ¶
type APISessionController struct {
APIBaseController
}
APISessionController manages vpn sessions
func (*APISessionController) Get ¶
func (c *APISessionController) Get()
Get lists vpn sessions @Title list @Description List vpn sessions @Success 200 request success @Failure 400 request failure @router / [get]
func (*APISessionController) Kill ¶
func (c *APISessionController) Kill()
Kill deletes vpn session @Title Kill @Description Delete (kill) session @Param body body controllers.KillParams true "CommonName of client to kill" @Success 200 request success @Failure 400 request failure @router / [delete]
type APISignalController ¶
type APISignalController struct {
APIBaseController
}
APISignalController sends signals to OpenVPN daemon
func (*APISignalController) Send ¶
func (c *APISignalController) Send()
Send signal to OpenVPN daemon @Title Send signal @Description Sends signal to OpenVPN daemon @Param body body controllers.SignalParams true "Signal to send" @Success 200 request success @Failure 400 request failure @router / [post]
type APISysloadController ¶
type APISysloadController struct {
APIBaseController
}
APISysloadController provides system information
func (*APISysloadController) Get ¶
func (c *APISysloadController) Get()
Get gives system information @Title Get system info @Description Shows OS stats @Success 200 request success @Failure 400 request failure @router / [get]
type BaseController ¶
type BaseController struct { beego.Controller Userinfo *models.User IsLogin bool }
func (*BaseController) DelLogin ¶
func (c *BaseController) DelLogin()
func (*BaseController) Finish ¶
func (c *BaseController) Finish()
func (*BaseController) GetLogin ¶
func (c *BaseController) GetLogin() *models.User
func (*BaseController) LoginPath ¶
func (c *BaseController) LoginPath() string
func (*BaseController) Prepare ¶
func (c *BaseController) Prepare()
func (*BaseController) SetLogin ¶
func (c *BaseController) SetLogin(user *models.User)
func (*BaseController) SetParams ¶
func (c *BaseController) SetParams()
type BreadCrumbs ¶
type CertificatesController ¶
type CertificatesController struct {
BaseController
}
func (*CertificatesController) Download ¶
func (c *CertificatesController) Download()
@router /certificates/:key [get]
func (*CertificatesController) Get ¶
func (c *CertificatesController) Get()
@router /certificates [get]
func (*CertificatesController) NestPrepare ¶
func (c *CertificatesController) NestPrepare()
func (*CertificatesController) Post ¶
func (c *CertificatesController) Post()
@router /certificates [post]
type JSONResponse ¶
type JSONResponse struct { Status string `json:"status"` Message string `json:"message"` Code string `json:"code,omitempty"` Data interface{} `json:"data,omitempty"` }
JSONResponse http://stackoverflow.com/a/12979961
func NewJSONResponse ¶
func NewJSONResponse() *JSONResponse
type KillParams ¶
type KillParams struct {
Cname string `json:"cname"`
}
KillParams contains CommonName of session to kill
type LoginController ¶
type LoginController struct {
BaseController
}
func (*LoginController) Login ¶
func (c *LoginController) Login()
func (*LoginController) Logout ¶
func (c *LoginController) Logout()
type LogsController ¶
type LogsController struct {
BaseController
}
func (*LogsController) Get ¶
func (c *LogsController) Get()
func (*LogsController) NestPrepare ¶
func (c *LogsController) NestPrepare()
type MainController ¶
type MainController struct {
BaseController
}
func (*MainController) Get ¶
func (c *MainController) Get()
func (*MainController) NestPrepare ¶
func (c *MainController) NestPrepare()
type NestFinisher ¶
type NestFinisher interface {
NestFinish()
}
type NestPreparer ¶
type NestPreparer interface {
NestPrepare()
}
type NewCertParams ¶
type NewCertParams struct {
Name string `form:"Name" valid:"Required;"`
}
type OVConfigController ¶
type OVConfigController struct {
BaseController
}
func (*OVConfigController) Get ¶
func (c *OVConfigController) Get()
func (*OVConfigController) NestPrepare ¶
func (c *OVConfigController) NestPrepare()
func (*OVConfigController) Post ¶
func (c *OVConfigController) Post()
type ProfileController ¶
type ProfileController struct {
BaseController
}
func (*ProfileController) Get ¶
func (c *ProfileController) Get()
func (*ProfileController) NestPrepare ¶
func (c *ProfileController) NestPrepare()
func (*ProfileController) Post ¶
func (c *ProfileController) Post()
type SettingsController ¶
type SettingsController struct {
BaseController
}
func (*SettingsController) Get ¶
func (c *SettingsController) Get()
func (*SettingsController) NestPrepare ¶
func (c *SettingsController) NestPrepare()
func (*SettingsController) Post ¶
func (c *SettingsController) Post()
type SignalParams ¶
type SignalParams struct {
Sname string `json:"sname"`
}
KillParams contains CommonName of session to kill