handlersAdmin

package
v0.0.0-...-791dfb5 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminLogin

func AdminLogin(c echo.Context) error

AdminLogin func

func AdminProfile

func AdminProfile(c echo.Context) error

AdminProfile check admin profile

func CreateClient

func CreateClient(c echo.Context) error

CreateClient func

func PermissionList

func PermissionList(c echo.Context) error

PermissionList get all defined permissions

func RandString

func RandString(n int) string

RandString random string alphanumeric. parameter length

func RoleDetails

func RoleDetails(c echo.Context) error

RoleDetails get role detail by id

func RoleList

func RoleList(c echo.Context) error

RoleList get all roles

func RoleNew

func RoleNew(c echo.Context) error

RoleNew create new role

func RolePatch

func RolePatch(c echo.Context) error

RolePatch edit role by id

func RoleRange

func RoleRange(c echo.Context) error

RoleRange get all role without pagination

func UserDetails

func UserDetails(c echo.Context) error

UserDetails get user detail by id

func UserFirstLoginChangePassword

func UserFirstLoginChangePassword(c echo.Context) error

UserFirstLoginChangePassword check if user is first login and change the password

func UserList

func UserList(c echo.Context) error

UserList gets all users

func UserNew

func UserNew(c echo.Context) error

UserNew create new user

func UserPatch

func UserPatch(c echo.Context) error

UserPatch edit user by id

Types

type AdminLoginCreds

type AdminLoginCreds struct {
	Key      string `json:"key"`
	Password string `json:"password"`
}

AdminLoginCreds admin credentials container

type JWTclaims

type JWTclaims struct {
	Username    string   `json:"username"`
	Group       string   `json:"group"`
	Permissions []string `json:"permissions"`
	jwt.StandardClaims
}

JWTclaims type

type RolePayload

type RolePayload struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	System      string   `json:"system"`
	Status      string   `json:"status"`
	Permissions []string `json:"permissions"`
}

RolePayload handles role request body

type UserPayload

type UserPayload struct {
	Roles    []int64 `json:"roles"`
	Username string  `json:"username"`
	Email    string  `json:"email"`
	Phone    string  `json:"phone"`
	Status   string  `json:"status"`
}

UserPayload handle user request body

type UserSelect

type UserSelect struct {
	// UserSelect custom query
	models.User
	RolesName pq.StringArray `json:"roles_name"`
}

UserSelect custom select container

Jump to

Keyboard shortcuts

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