controllers

package
v0.0.0-...-d4b96c7 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetText

func GetText(tpl string, c clientconfig.Config) (string, error)

func SaveToFile

func SaveToFile(tplPath string, c clientconfig.Config, destPath string) error

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 {
	web.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 struct {
	Title    string
	Subtitle string
}

type CertificatesController

type CertificatesController struct {
	BaseController
	ConfigDir string
}

func (*CertificatesController) Burn

func (c *CertificatesController) Burn()

@router /certificates/burn/:key/:serial/:tfaname [get]

func (*CertificatesController) DisplayImage

func (c *CertificatesController) DisplayImage()

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]

func (*CertificatesController) Renew

func (c *CertificatesController) Renew()

@router /certificates/revoke/:key [get]

func (*CertificatesController) Restart

func (c *CertificatesController) Restart()

@router /certificates/restart [get]

func (*CertificatesController) Revoke

func (c *CertificatesController) Revoke()

@router /certificates/revoke/:key [get]

type DangerController

type DangerController struct {
	BaseController
}

func (*DangerController) DeletePKI

func (c *DangerController) DeletePKI()

@router /pki/delete/:key [DeletePKI]

func (*DangerController) Get

func (c *DangerController) Get()

func (*DangerController) InitPKI

func (c *DangerController) InitPKI()

@router /pki/init/:key [InitPKI]

func (*DangerController) NestPrepare

func (c *DangerController) NestPrepare()

func (*DangerController) RestartContainer

func (c *DangerController) RestartContainer()

@router /container/restart [RestartContainer]

type EasyRSAConfigController

type EasyRSAConfigController struct {
	BaseController
	ConfigDir string
}

func (*EasyRSAConfigController) Get

func (c *EasyRSAConfigController) Get()

func (*EasyRSAConfigController) NestPrepare

func (c *EasyRSAConfigController) NestPrepare()

func (*EasyRSAConfigController) Post

func (c *EasyRSAConfigController) 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) GoogleCallback

func (c *LoginController) GoogleCallback()

func (*LoginController) GoogleLogin

func (c *LoginController) GoogleLogin()

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;"`
	Staticip   string `form:"staticip"`
	Passphrase string `form:"passphrase"`
	ExpireDays string `form:"EasyRSACertExpire"`
	Email      string `form:"EasyRSAReqEmail"`
	Country    string `form:"EasyRSAReqCountry"`
	Province   string `form:"EasyRSAReqProvince"`
	City       string `form:"EasyRSAReqCity"`
	Org        string `form:"EasyRSAReqOrg"`
	OrgUnit    string `form:"EasyRSAReqOu"`
	TFAName    string `form:"TFAName"`
	TFAIssuer  string `form:"TFAIssuer"`
}

type NewUser

type NewUser struct {
	NewLogin      string `orm:"size(64);unique" form:"NewLogin" valid:"Required;"`
	NewName       string `orm:"size(64);unique" form:"NewName" valid:"Required;"`
	NewIsAdmin    bool   `orm:"default(false)" form:"IsAdmin" valid:"Required;"`
	NewEmail      string `orm:"size(64)" form:"NewEmail" valid:"Required;Email"`
	NewPassword   string `orm:"size(32)" form:"NewPassword" valid:"Required;MinSize(6)"`
	NewRepassword string `orm:"-" form:"NewRepassword" valid:"Required"`
}

type OVClientConfigController

type OVClientConfigController struct {
	BaseController
	ConfigDir string
}

func (*OVClientConfigController) Edit

func (c *OVClientConfigController) Edit()

@router /ov/clientconfig/edit [Edit]

func (*OVClientConfigController) Get

func (c *OVClientConfigController) Get()

func (*OVClientConfigController) NestPrepare

func (c *OVClientConfigController) NestPrepare()

func (*OVClientConfigController) Post

func (c *OVClientConfigController) Post()

type OVConfigController

type OVConfigController struct {
	BaseController
	ConfigDir string
}

func (*OVConfigController) Edit

func (c *OVConfigController) Edit()

@router /ov/config/edit [Edit]

func (*OVConfigController) Get

func (c *OVConfigController) Get()

@router /ov/config [Get]

func (*OVConfigController) NestPrepare

func (c *OVConfigController) NestPrepare()

func (*OVConfigController) Post

func (c *OVConfigController) Post()

@router /ov/config [Post]

type ProfileController

type ProfileController struct {
	BaseController
}

func (*ProfileController) Create

func (c *ProfileController) Create()

@router /profile/create [Create]

func (*ProfileController) DeleteUser

func (c *ProfileController) DeleteUser()

@router /profile/delete/:key [get]

func (*ProfileController) EditUser

func (c *ProfileController) EditUser()

@router /profile/edit/:key [post]

func (*ProfileController) Get

func (c *ProfileController) Get()

func (*ProfileController) List

func (c *ProfileController) List()

@router /profile [post]

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

Jump to

Keyboard shortcuts

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