server

package
v0.0.0-...-5a38bd3 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger *zap.Logger

Functions

func CanExecute

func CanExecute() gin.HandlerFunc

func CanRead

func CanRead() gin.HandlerFunc

func CanWrite

func CanWrite() gin.HandlerFunc

func CheckGroup

func CheckGroup() gin.HandlerFunc

func CheckRole

func CheckRole() gin.HandlerFunc

func CheckRolesExist

func CheckRolesExist() gin.HandlerFunc

func DeleteCommand

func DeleteCommand(c *gin.Context)

func GetDb

func GetDb() *sql.DB

func GetJwtSecret

func GetJwtSecret() []byte

func InitServer

func InitServer() *gin.Engine

func IsAdmin

func IsAdmin() gin.HandlerFunc

func KillCommand

func KillCommand(c *gin.Context)

func NewCommand

func NewCommand(c *gin.Context)

func RunCommand

func RunCommand(c *gin.Context)

func RunServer

func RunServer(portString string, router *gin.Engine)

func SetDb

func SetDb(sqlDb *sql.DB)

func SetJwtSecret

func SetJwtSecret(secret []byte)

func SetLogger

func SetLogger(log *zap.Logger)

func Signin

func Signin(c *gin.Context)

func Signout

func Signout(c *gin.Context)

func Signup

func Signup(c *gin.Context)

func VerifyToken

func VerifyToken() gin.HandlerFunc

Types

type AdminCheck

type AdminCheck struct {
	User  string `json:user`
	Group string `json:group`
}

type AuthCheck

type AuthCheck struct {
	Token string `header:"authorization"`
}

type CommandVerification

type CommandVerification struct {
	User    string `json:user`
	Group   string `json:group`
	Role    string `json:role`
	Process string `json:process`
}

type ConciergeTokenClaims

type ConciergeTokenClaims struct {
	User string `json:"user"`
	jwt.StandardClaims
}

type DeleteCommandBody

type DeleteCommandBody struct {
	CommandName string `json:commandname`
}

type GroupCheck

type GroupCheck struct {
	User  string `json:user`
	Group string `json:group`
}

type NewCommandBody

type NewCommandBody struct {
	User        string `json:user`
	Group       string `json:group`
	CommandName string `json:commandname`
	RunCommand  string `json:runcommand`
	KillCommand string `json:killcommand`
}

type RoleCheck

type RoleCheck struct {
	User  string `json:user`
	Group string `json:group`
	Role  string `json:group`
}

type RolesCheck

type RolesCheck struct {
	Roles []string `json:roles`
}

type SigninBody

type SigninBody struct {
	User     string `json:user`
	Password string `json:group`
}

type SigninRes

type SigninRes struct {
	User        string
	Auth        bool
	AccessToken string
}

type SignupBody

type SignupBody struct {
	User     string `json:user`
	Email    string `json:group`
	Password string `json:group`
}

type UserCheck

type UserCheck struct {
	User string `json:user`
}

Jump to

Keyboard shortcuts

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