handler

package
v0.0.0-...-054b70b Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2021 License: GPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountCtrl

type AccountCtrl struct {
	UserService *service.UserService `inject:""`

	UserRepo  *repo.UserRepo  `inject:""`
	TokenRepo *repo.TokenRepo `inject:""`
	RoleRepo  *repo.RoleRepo  `inject:""`
	PermRepo  *repo.PermRepo  `inject:""`
}

func NewAccountCtrl

func NewAccountCtrl() *AccountCtrl

func (*AccountCtrl) UserExpire

func (c *AccountCtrl) UserExpire(ctx iris.Context)

* * @api {get} /expire 刷新token * @apiName 刷新token * @apiGroup Users * @apiVersion 1.0.0 * @apiDescription 刷新token * @apiSampleRequest /expire * @apiSuccess {String} msg 消息 * @apiSuccess {bool} state 状态 * @apiSuccess {String} data 返回数据 * @apiPermission null

func (*AccountCtrl) UserLogin

func (c *AccountCtrl) UserLogin(ctx iris.Context)

* * @api {post} /admin/login 用户登陆 * @apiName 用户登陆 * @apiGroup Users * @apiVersion 1.0.0 * @apiDescription 用户登陆 * @apiSampleRequest /admin/login * @apiParam {string} username 用户名 * @apiParam {string} password 密码 * @apiSuccess {String} msg 消息 * @apiSuccess {bool} state 状态 * @apiSuccess {String} data 返回数据 * @apiPermission null

func (*AccountCtrl) UserLogout

func (c *AccountCtrl) UserLogout(ctx iris.Context)

* * @api {get} /logout 用户退出登陆 * @apiName 用户退出登陆 * @apiGroup Users * @apiVersion 1.0.0 * @apiDescription 用户退出登陆 * @apiSampleRequest /logout * @apiSuccess {String} msg 消息 * @apiSuccess {bool} state 状态 * @apiSuccess {String} data 返回数据 * @apiPermission null

type AppiumCtrl

type AppiumCtrl struct {
	Ctx     iris.Context
	Service *service.AppiumService `inject:""`
}

func NewAppiumCtrl

func NewAppiumCtrl() *AppiumCtrl

type BaseCtrl

type BaseCtrl struct {
	Ctx iris.Context
}

func (*BaseCtrl) Validate

func (c *BaseCtrl) Validate(s interface{}, ctx iris.Context) bool

type BuildCtrl

type BuildCtrl struct {
	Ctx          iris.Context
	BuildService *service.BuildService `inject:""`
	ResService   *service.ResService   `inject:""`

	BuildRepo *repo.BuildRepo `inject:""`
}

func NewBuildCtrl

func NewBuildCtrl() *BuildCtrl

func (*BuildCtrl) BeforeResultSave

func (c *BuildCtrl) BeforeResultSave(ctx iris.Context, file *multipart.FileHeader) bool

func (*BuildCtrl) UpdateResult

func (c *BuildCtrl) UpdateResult(ctx iris.Context)

type ClusterCtrl

type ClusterCtrl struct {
	Ctx            iris.Context
	ClusterService *service.ClusterService `inject:""`
}

func NewClusterCtrl

func NewClusterCtrl() *ClusterCtrl

func (*ClusterCtrl) Get

func (c *ClusterCtrl) Get(ctx iris.Context)

func (*ClusterCtrl) List

func (c *ClusterCtrl) List(ctx iris.Context)

type ContainerCtrl

type ContainerCtrl struct {
	Ctx              iris.Context
	ContainerService *service.ContainerService `inject:""`
}

func NewContainerCtrl

func NewContainerCtrl() *ContainerCtrl

func (*ContainerCtrl) Register

func (c *ContainerCtrl) Register(ctx iris.Context)

type ContainerImageCtrl

type ContainerImageCtrl struct {
	Ctx          iris.Context
	ImageService *service.DockerImageService `inject:""`
}

func NewContainerImageCtrl

func NewContainerImageCtrl() *ContainerImageCtrl

type DeviceCtrl

type DeviceCtrl struct {
	Ctx     iris.Context
	Service *service.DeviceService `inject:""`
}

func NewDeviceCtrl

func NewDeviceCtrl() *DeviceCtrl

func (*DeviceCtrl) PostRegister

func (g *DeviceCtrl) PostRegister() (result _domain.RpcResult)

type EnvCtrl

type EnvCtrl struct {
	Ctx        iris.Context
	EnvService *service.EnvService `inject:""`
}

func NewEnvCtrl

func NewEnvCtrl() *EnvCtrl

func (*EnvCtrl) List

func (c *EnvCtrl) List(ctx iris.Context)

type FileCtrl

type FileCtrl struct {
	Ctx iris.Context
}

func NewFileCtrl

func NewFileCtrl() *FileCtrl

func (*FileCtrl) PostUpload

func (g *FileCtrl) PostUpload()

type InitCtrl

type InitCtrl struct {
	SeederService *service.SeederService `inject:""`
}

func NewInitCtrl

func NewInitCtrl() *InitCtrl

func (*InitCtrl) InitData

func (c *InitCtrl) InitData(ctx iris.Context)

type PermCtrl

type PermCtrl struct {
	UserRepo *repo.UserRepo `inject:""`
	PermRepo *repo.PermRepo `inject:""`
}

func NewPermCtrl

func NewPermCtrl() *PermCtrl

func (*PermCtrl) CreatePermission

func (c *PermCtrl) CreatePermission(ctx iris.Context)

* * @api {post} /admin/permissions/ 新建权限 * @apiName 新建权限 * @apiGroup Permissions * @apiVersion 1.0.0 * @apiDescription 新建权限 * @apiSampleRequest /admin/permissions/ * @apiParam {string} name 权限名 * @apiParam {string} display_name * @apiParam {string} description * @apiParam {string} level * @apiSuccess {String} msg 消息 * @apiSuccess {bool} state 状态 * @apiSuccess {String} data 返回数据 * @apiPermission null

func (*PermCtrl) DeletePermission

func (c *PermCtrl) DeletePermission(ctx iris.Context)

* * @api {delete} /admin/permissions/:id/delete 删除权限 * @apiName 删除权限 * @apiGroup Permissions * @apiVersion 1.0.0 * @apiDescription 删除权限 * @apiSampleRequest /admin/permissions/:id/delete * @apiSuccess {String} msg 消息 * @apiSuccess {bool} state 状态 * @apiSuccess {String} data 返回数据 * @apiPermission null

func (*PermCtrl) GetAllPermissions

func (c *PermCtrl) GetAllPermissions(ctx iris.Context)

* * @api {get} /permissions 获取所有的权限 * @apiName 获取所有的权限 * @apiGroup Permissions * @apiVersion 1.0.0 * @apiDescription 获取所有的权限 * @apiSampleRequest /permissions * @apiSuccess {String} msg 消息 * @apiSuccess {bool} state 状态 * @apiSuccess {String} data 返回数据 * @apiPermission null

func (*PermCtrl) GetPermission

func (c *PermCtrl) GetPermission(ctx iris.Context)

* * @api {get} /admin/permissions/:id 根据id获取权限信息 * @apiName 根据id获取权限信息 * @apiGroup Permissions * @apiVersion 1.0.0 * @apiDescription 根据id获取权限信息 * @apiSampleRequest /admin/permissions/:id * @apiSuccess {String} msg 消息 * @apiSuccess {bool} state 状态 * @apiSuccess {String} data 返回数据 * @apiPermission

func (*PermCtrl) UpdatePermission

func (c *PermCtrl) UpdatePermission(ctx iris.Context)

* * @api {post} /admin/permissions/:id/update 更新权限 * @apiName 更新权限 * @apiGroup Permissions * @apiVersion 1.0.0 * @apiDescription 更新权限 * @apiSampleRequest /admin/permissions/:id/update * @apiParam {string} name 权限名 * @apiParam {string} display_name * @apiParam {string} description * @apiParam {string} level * @apiSuccess {String} msg 消息 * @apiSuccess {bool} state 状态 * @apiSuccess {String} data 返回数据 * @apiPermission null

type PlanCtrl

type PlanCtrl struct {
	BaseCtrl

	PlanService *service.PlanService `inject:""`
	TaskService *service.TaskService `inject:""`
}

func NewPlanCtrl

func NewPlanCtrl() *PlanCtrl

func (*PlanCtrl) Create

func (c *PlanCtrl) Create(ctx iris.Context)

func (*PlanCtrl) Delete

func (c *PlanCtrl) Delete(ctx iris.Context)

func (*PlanCtrl) Get

func (c *PlanCtrl) Get(ctx iris.Context)

func (*PlanCtrl) List

func (c *PlanCtrl) List(ctx iris.Context)

func (*PlanCtrl) Update

func (c *PlanCtrl) Update(ctx iris.Context)

type ResCtrl

type ResCtrl struct {
	Ctx        iris.Context
	ResService *service.ResService `inject:""`
}

func NewMachineCtrl

func NewMachineCtrl() *ResCtrl

func (*ResCtrl) Get

func (c *ResCtrl) Get(ctx iris.Context)

func (*ResCtrl) ListContainer

func (c *ResCtrl) ListContainer(ctx iris.Context)

func (*ResCtrl) ListVm

func (c *ResCtrl) ListVm(ctx iris.Context)

type RoleCtrl

type RoleCtrl struct {
	RoleService *service.RoleService `inject:""`

	UserRepo *repo.UserRepo `inject:""`
	RoleRepo *repo.RoleRepo `inject:""`
	PermRepo *repo.PermRepo `inject:""`
}

func NewRoleCtrl

func NewRoleCtrl() *RoleCtrl

func (*RoleCtrl) CreateRole

func (c *RoleCtrl) CreateRole(ctx iris.Context)

* * @api {post} /admin/roles/ 新建角色 * @apiName 新建角色 * @apiGroup Roles * @apiVersion 1.0.0 * @apiDescription 新建角色 * @apiSampleRequest /admin/roles/ * @apiParam {string} name 角色名 * @apiParam {string} display_name * @apiParam {string} description * @apiParam {string} level * @apiSuccess {String} msg 消息 * @apiSuccess {bool} state 状态 * @apiSuccess {String} data 返回数据 * @apiPermission null

func (*RoleCtrl) DeleteRole

func (c *RoleCtrl) DeleteRole(ctx iris.Context)

* * @api {delete} /admin/roles/:id/delete 删除角色 * @apiName 删除角色 * @apiGroup Roles * @apiVersion 1.0.0 * @apiDescription 删除角色 * @apiSampleRequest /admin/roles/:id/delete * @apiSuccess {String} msg 消息 * @apiSuccess {bool} state 状态 * @apiSuccess {String} data 返回数据 * @apiPermission null

func (*RoleCtrl) GetAllRoles

func (c *RoleCtrl) GetAllRoles(ctx iris.Context)

* * @api {get} /roles 获取所有的角色 * @apiName 获取所有的角色 * @apiGroup Roles * @apiVersion 1.0.0 * @apiDescription 获取所有的角色 * @apiSampleRequest /roles * @apiSuccess {String} msg 消息 * @apiSuccess {bool} state 状态 * @apiSuccess {String} data 返回数据 * @apiPermission null

func (*RoleCtrl) GetRole

func (c *RoleCtrl) GetRole(ctx iris.Context)

* * @api {get} /admin/roles/:id 根据id获取角色信息 * @apiName 根据id获取角色信息 * @apiGroup Roles * @apiVersion 1.0.0 * @apiDescription 根据id获取角色信息 * @apiSampleRequest /admin/roles/:id * @apiSuccess {String} msg 消息 * @apiSuccess {bool} state 状态 * @apiSuccess {String} data 返回数据 * @apiPermission

func (*RoleCtrl) UpdateRole

func (c *RoleCtrl) UpdateRole(ctx iris.Context)

* * @api {post} /admin/roles/:id/update 更新角色 * @apiName 更新角色 * @apiGroup Roles * @apiVersion 1.0.0 * @apiDescription 更新角色 * @apiSampleRequest /admin/roles/:id/update * @apiParam {string} name 角色名 * @apiParam {string} display_name * @apiParam {string} description * @apiParam {string} level * @apiSuccess {String} msg 消息 * @apiSuccess {bool} state 状态 * @apiSuccess {String} data 返回数据 * @apiPermission null

type RpcCtrl

type RpcCtrl struct {
	Ctx        iris.Context
	RpcService *service.RpcService `inject:""`
}

func NewRpcCtrl

func NewRpcCtrl() *RpcCtrl

func (*RpcCtrl) Request

func (c *RpcCtrl) Request(ctx iris.Context)

type TaskCtrl

type TaskCtrl struct {
	Ctx          iris.Context
	TaskService  *service.TaskService  `inject:""`
	QueueService *service.QueueService `inject:""`
}

func NewTaskCtrl

func NewTaskCtrl() *TaskCtrl

func (*TaskCtrl) Get

func (c *TaskCtrl) Get(ctx iris.Context)

type UserCtrl

type UserCtrl struct {
	UserService *service.UserService `inject:""`
	RoleService *service.RoleService `inject:""`
	UserRepo    *repo.UserRepo       `inject:""`
	RoleRepo    *repo.RoleRepo       `inject:""`
}

func NewUserCtrl

func NewUserCtrl() *UserCtrl

func (*UserCtrl) ChangeAvatar

func (c *UserCtrl) ChangeAvatar(ctx iris.Context)

* * @api {get} /admin/change_avatar 修改头像 * @apiName 修改头像 * @apiGroup Users * @apiVersion 1.0.0 * @apiDescription 修改头像 * @apiSampleRequest /admin/change_avatar * @apiSuccess {String} msg 消息 * @apiSuccess {bool} state 状态 * @apiSuccess {String} data 返回数据 * @apiPermission 登陆用户

func (*UserCtrl) CreateUser

func (c *UserCtrl) CreateUser(ctx iris.Context)

* * @api {post} /admin/users/ 新建账号 * @apiName 新建账号 * @apiGroup Users * @apiVersion 1.0.0 * @apiDescription 新建账号 * @apiSampleRequest /admin/users/ * @apiParam {string} username 用户名 * @apiParam {string} password 密码 * @apiSuccess {String} msg 消息 * @apiSuccess {bool} state 状态 * @apiSuccess {String} data 返回数据 * @apiPermission null

func (*UserCtrl) DeleteUser

func (c *UserCtrl) DeleteUser(ctx iris.Context)

* * @api {delete} /admin/users/:id/delete 删除用户 * @apiName 删除用户 * @apiGroup Users * @apiVersion 1.0.0 * @apiDescription 删除用户 * @apiSampleRequest /admin/users/:id/delete * @apiSuccess {String} msg 消息 * @apiSuccess {bool} state 状态 * @apiSuccess {String} data 返回数据 * @apiPermission null

func (*UserCtrl) GetAdminInfo

func (c *UserCtrl) GetAdminInfo(ctx iris.Context)

* * @api {get} /profile 管理员信息 * @apiName 管理员信息 * @apiGroup Users * @apiVersion 1.0.0 * @apiDescription 管理员信息 * @apiSampleRequest /profile * @apiSuccess {String} msg 消息 * @apiSuccess {bool} state 状态 * @apiSuccess {String} data 返回数据 * @apiPermission 登陆用户

func (*UserCtrl) GetAllUsers

func (c *UserCtrl) GetAllUsers(ctx iris.Context)

* * @api {get} /users 获取所有的账号 * @apiName 获取所有的账号 * @apiGroup Users * @apiVersion 1.0.0 * @apiDescription 获取所有的账号 * @apiSampleRequest /users * @apiSuccess {String} msg 消息 * @apiSuccess {bool} state 状态 * @apiSuccess {String} data 返回数据 * @apiPermission null

func (*UserCtrl) GetProfile

func (c *UserCtrl) GetProfile(ctx iris.Context)

* * @api {get} /admin/profile 获取登陆用户信息 * @apiName 获取登陆用户信息 * @apiGroup Users * @apiVersion 1.0.0 * @apiDescription 获取登陆用户信息 * @apiSampleRequest /admin/profile * @apiSuccess {String} msg 消息 * @apiSuccess {bool} state 状态 * @apiSuccess {String} data 返回数据 * @apiPermission 登陆用户

func (*UserCtrl) GetUser

func (c *UserCtrl) GetUser(ctx iris.Context)

* * @api {get} /admin/users/:id 根据id获取用户信息 * @apiName 根据id获取用户信息 * @apiGroup Users * @apiVersion 1.0.0 * @apiDescription 根据id获取用户信息 * @apiSampleRequest /admin/users/:id * @apiSuccess {String} msg 消息 * @apiSuccess {bool} state 状态 * @apiSuccess {String} data 返回数据 * @apiPermission 登陆用户

func (*UserCtrl) UpdateUser

func (c *UserCtrl) UpdateUser(ctx iris.Context)

* * @api {post} /admin/users/:id/update 更新账号 * @apiName 更新账号 * @apiGroup Users * @apiVersion 1.0.0 * @apiDescription 更新账号 * @apiSampleRequest /admin/users/:id/update * @apiParam {string} username 用户名 * @apiParam {string} password 密码 * @apiSuccess {String} msg 消息 * @apiSuccess {bool} state 状态 * @apiSuccess {String} data 返回数据 * @apiPermission null

type VmCtrl

type VmCtrl struct {
	Ctx       iris.Context
	VmService *service.VmService `inject:""`
}

func NewVmCtrl

func NewVmCtrl() *VmCtrl

func (*VmCtrl) Register

func (c *VmCtrl) Register(ctx iris.Context)

type VmTemplCtrl

type VmTemplCtrl struct {
	Ctx            iris.Context
	VmTemplService *service.VmTemplService `inject:""`
}

func NewVmTemplCtrl

func NewVmTemplCtrl() *VmTemplCtrl

func (*VmTemplCtrl) Load

func (c *VmTemplCtrl) Load(ctx iris.Context)

func (*VmTemplCtrl) Update

func (c *VmTemplCtrl) Update(ctx iris.Context)

type WsCtrl

type WsCtrl struct {
	BaseCtrl
	*websocket.NSConn `stateless:"true"`
	Namespace         string
}

func NewWsCtrl

func NewWsCtrl() *WsCtrl

func (*WsCtrl) OnChat

func (c *WsCtrl) OnChat(msg websocket.Message) (err error)

This will call the "OnVisit" event on all clients, including the current one, with the 'newCount' variable.

func (*WsCtrl) OnNamespaceConnected

func (c *WsCtrl) OnNamespaceConnected(msg websocket.Message) error

func (*WsCtrl) OnNamespaceDisconnect

func (c *WsCtrl) OnNamespaceDisconnect(msg websocket.Message) error

This will call the "OnVisit" event on all clients, except the current one, (it can't because it's left but for any case use this type of design)

Jump to

Keyboard shortcuts

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