handlers

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//SUCCESS_PESP_CODE The code returned on successful request
	SUCCESS_PESP_CODE = 200
	//INPUT_MISSING_PESP_CODE The code returned if the required parameters are missing
	INPUT_MISSING_PESP_CODE = 202
	//INPUT_ERROR_RESP_CODE The code returned when an error is inputted
	INPUT_ERROR_RESP_CODE = 204
	//SERVER_ERROR_RESP_CODE The code returned by the server when an error occurred
	SERVER_ERROR_RESP_CODE = 500
)
View Source
const (
	//INPUT_MISSING_MSG  The msg returned if the required parameters are missing
	INPUT_MISSING_MSG = "Missing required parameters"
	//INPUT_ERROR_MSG The msg returned when an error is inputted
	INPUT_ERROR_MSG = "There is an error in the input parameter"
	//SERVER_ERROR_MSG The msg returned by the server when an error occurred
	SERVER_ERROR_MSG = "An error occurred with the internal service"
	//SUCCESS_MSG The msg returned on successful request
	SUCCESS_MSG = "The request service returned successfully"
)

Variables

This section is empty.

Functions

func GenCert

func GenCert() gin.HandlerFunc

Generate certificate

func GenCertByCsr

func GenCertByCsr() gin.HandlerFunc

Certificates are generated by the CSR

func GenCrl

func GenCrl() gin.HandlerFunc

Generate crl

func GenCsr

func GenCsr() gin.HandlerFunc

generate csr

func GetCertNodeId

func GetCertNodeId() gin.HandlerFunc

GetTLSCertNodeId

func InputErrorJSONResp

func InputErrorJSONResp(err string, c *gin.Context)

Input error response

func InputMissingJSONResp

func InputMissingJSONResp(err string, c *gin.Context)

Input empty response

func JWTAuthMiddleware

func JWTAuthMiddleware() gin.HandlerFunc

JWTAuthMiddleware

func Login

func Login() gin.HandlerFunc

func QueryCerts

func QueryCerts() gin.HandlerFunc

Query certificates

func RenewCert

func RenewCert() gin.HandlerFunc

renew certificate

func RevokeCert

func RevokeCert() gin.HandlerFunc

Revoke certificate

func ServerErrorJSONResp

func ServerErrorJSONResp(err string, c *gin.Context)

Service error response

func SuccessfulJSONResp

func SuccessfulJSONResp(data interface{}, c *gin.Context)

Successful response

Types

type GenCertByCsrReq

type GenCertByCsrReq struct {
	OrgId     string `json:"orgId"`
	UserId    string `json:"userId"`
	UserType  string `json:"userType"`
	CertUsage string `json:"certUsage"`
	Csr       string `json:"csr"`
	Token     string `json:"token"`
}

type GenCertReq

type GenCertReq struct {
	OrgId         string `json:"orgId"`
	UserId        string `json:"userId"`
	UserType      string `json:"userType"`
	CertUsage     string `json:"certUsage"`
	PrivateKeyPwd string `json:"privateKeyPwd"`
	Country       string `json:"country"`
	Locality      string `json:"locality"`
	Province      string `json:"province"`
	Token         string `json:"token"`
}

type GenCrlReq

type GenCrlReq struct {
	IssuerCertSn int64  `json:"issuerCertSn"`
	Token        string `json:"token"`
}

type GenCsrReq

type GenCsrReq struct {
	OrgId         string `json:"orgId"`
	UserId        string `json:"userId"`
	UserType      string `json:"userType"`
	PrivateKeyPwd string `json:"privateKeyPwd"`
	Country       string `json:"country"`
	Locality      string `json:"locality"`
	Province      string `json:"province"`
	Token         string `json:"token"`
}

type GetNodeIdReq

type GetNodeIdReq struct {
	OrgId     string `json:"orgId"`
	UserId    string `json:"userId"`
	UserType  string `json:"userType"`
	CertUsage string `json:"certUsage"`
	CertSn    int64  `json:"certSn"`
	Token     string `json:"token"`
}

type LoginReq

type LoginReq struct {
	AppId  string `json:"appId"`
	AppKey string `json:"appKey"`
	Token  string `json:"token"`
}

type LoginResp

type LoginResp struct {
	AccessToken string `json:"accessToken"`
	ExpiressIn  int64  `json:"expiressIn"`
}

type QueryCertReq

type QueryCertReq struct {
	CertSn    int64  `json:"certSn"`
	OrgId     string `json:"orgId"`
	UserId    string `json:"userId"`
	UserType  string `json:"userType"`
	CertUsage string `json:"certUsage"`
	Token     string `json:"token"`
}

type RenewCertReq

type RenewCertReq struct {
	CertSn int64  `json:"certSn"`
	Token  string `json:"token"`
}

type RevokeCertReq

type RevokeCertReq struct {
	RevokedCertSn int64  `json:"revokedCertSn"`
	IssuerCertSn  int64  `json:"issuerCertSn"`
	Reason        string `json:"reason"`
	Token         string `json:"token"`
}

type StandardResp

type StandardResp struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

type TokenReq

type TokenReq struct {
	Token string `json:"token"`
}

Jump to

Keyboard shortcuts

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