Documentation ¶
Index ¶
- Constants
- Variables
- func AddBatchNode(c *gin.Context) error
- func ApplicationHandlerRoutes(r *gin.Engine)
- func Auth() gin.HandlerFunc
- func ConfirmNodesBatch(c *gin.Context) error
- func CreateEdgeApp(c *gin.Context) error
- func CreateEdgeNode(c *gin.Context) error
- func CreateImageOrg(c *gin.Context) error
- func CreateNodeBatch(c *gin.Context) error
- func DeleteEdgeApp(c *gin.Context) error
- func DeleteEdgeAppVersion(c *gin.Context) error
- func DeleteEdgeNode(c *gin.Context) error
- func DeleteImage(c *gin.Context) error
- func DeleteImageOrg(c *gin.Context) error
- func DeleteImageVersion(c *gin.Context) error
- func DeleteNodeOfBatch(c *gin.Context) error
- func DeployEdgeApp(c *gin.Context) error
- func DescribeContainerImage(c *gin.Context) error
- func DescribeContainerImageVersion(c *gin.Context) error
- func DescribeEdgeApp(c *gin.Context) error
- func DescribeEdgeAppVersion(c *gin.Context) error
- func DescribeEdgeNode(c *gin.Context) error
- func GetInstallScripts(c *gin.Context) error
- func GetTempNodesBatchList(c *gin.Context) error
- func GetUserInfo(c *gin.Context) (int64, int64, int64, error)
- func HandleNotFound(c *gin.Context)
- func HandleProb(c *gin.Context)
- func ImageHandlerRoutes(r *gin.Engine)
- func InitAuth(config *configs.EdgeCloudConfig) error
- func ListArchType(c *gin.Context) error
- func ListContainerImage(c *gin.Context) error
- func ListContainerImageVersion(c *gin.Context) error
- func ListEdgeAppDeploys(c *gin.Context) error
- func ListEdgeAppVersions(c *gin.Context) error
- func ListEdgeApps(c *gin.Context) error
- func ListEdgeNodeType(c *gin.Context) error
- func ListEdgeNodes(c *gin.Context) error
- func ListImageOrg(c *gin.Context) error
- func ListNodeCanDeploy(c *gin.Context) error
- func ListNodeDeploys(c *gin.Context) error
- func NewRouter() *gin.Engine
- func NoReqSuccessResp(c *gin.Context, content interface{}) error
- func NodeHandlerRoutes(r *gin.Engine)
- func OfflineEdgeAppVersion(c *gin.Context) error
- func PublishEdgeAppVersion(c *gin.Context) error
- func StartApiServer(config *configs.EdgeCloudConfig) *http.Server
- func StopApiServer(srv *http.Server)
- func SuccessResp(c *gin.Context, req *proto.Message, content interface{}) error
- func UnDeployEdgeApp(c *gin.Context) error
- func UploadContainerImage(c *gin.Context) error
- func UploadNodeFile(c *gin.Context) error
- type APIErrorResp
- func AppError(c *gin.Context, req *proto.Message, errCode int, msg string) *APIErrorResp
- func ErrorNoBodyResp(code int, msg string) *APIErrorResp
- func ErrorResp(c *gin.Context, req *proto.Message, code int, msg string) (*proto.Message, *APIErrorResp)
- func NoBodyUnAuthorizedError(msg string) *APIErrorResp
- func NoReqAppError(c *gin.Context, msg string) *APIErrorResp
- func NotFoundError(c *gin.Context, req *proto.Message) *APIErrorResp
- func ParameterError(c *gin.Context, req *proto.Message, msg string) *APIErrorResp
- func PreHandler(c *gin.Context, req *proto.Message, reqContent interface{}) (*proto.ApulisHeader, *APIErrorResp)
- func ServeError(c *gin.Context, req *proto.Message, errCode int, msg string) *APIErrorResp
- func ServerError(c *gin.Context, req *proto.Message) *APIErrorResp
- func UnAuthorizedError(c *gin.Context, req *proto.Message, msg string) *APIErrorResp
- func UnknownError(c *gin.Context, req *proto.Message, msg string) *APIErrorResp
- type APISuccessResp
- type HandlerFunc
Constants ¶
const ( SUCCESS_CODE = 0 NOT_FOUND_ERROR_CODE = 10001 UNKNOWN_ERROR_CODE = 10002 SERVER_ERROR_CODE = 10003 // Request error codes PARAMETER_ERROR_CODE = 20001 AUTH_ERROR_CODE = 20002 // APP error codes APP_ERROR_CODE = 30000 FILETYPE_NOT_SUPPORTED_CODE = 30001 SAVE_FILE_ERROR_CODE = 30002 EXTRACT_FILE_ERROR_CODE = 30003 REMOVE_FILE_ERROR_CODE = 30004 FILEPATH_NOT_EXISTS_CODE = 30005 FILE_OVERSIZE_CODE = 30006 FILEPATH_NOT_VALID_CODE = 30007 COMPRESS_PATH_ERROR_CODE = 30008 // application APP_STILL_HAVE_DEPLOY = 30101 REMOTE_SERVE_ERROR_CODE = 40000 )
const ( InvalidClusterId int64 = -1 InvalidGroupId int64 = -1 InvalidUserId int64 = -1 )
user manage
Variables ¶
var ( ErrInvalidClusterId = errors.New("Invalid cluster id") ErrInvalidGroupId = errors.New("Invalid group id") ErrInvalidUserId = errors.New("Invalid user id") ErrInvalidUserInfo = errors.New("Invalid user info") ErrOrgNameNeeded = errors.New("Need org name") ErrIDontHaveOrg = errors.New("I don`t have this org") )
Functions ¶
func AddBatchNode ¶
func Auth ¶
func Auth() gin.HandlerFunc
func ConfirmNodesBatch ¶
func CreateEdgeApp ¶
create edge application this interface can both create basic app and app version
func CreateEdgeNode ¶
@Summary create edge node @Description create edge node @Tags node @Accept json @Produce json @Param param body node.CreateEdgeNodeReq true "userId:user id, userName: user name" @Success 200 {object} APISuccessResp{data=node.CreateEdgeNodeRsp} @Failure 400 {object} APIErrorResp @Router /createNode [post]
func CreateNodeBatch ¶
func DeleteEdgeAppVersion ¶
delete edge application version
func DeleteNodeOfBatch ¶
func DescribeContainerImageVersion ¶
describe image version
func DescribeEdgeAppVersion ¶
describe edge application version
func GetInstallScripts ¶
func GetTempNodesBatchList ¶
func GetUserInfo ¶
Get user info from context
func HandleNotFound ¶
func HandleProb ¶
func ImageHandlerRoutes ¶
func InitAuth ¶
func InitAuth(config *configs.EdgeCloudConfig) error
func ListArchType ¶
func ListContainerImage ¶
func ListEdgeNodeType ¶
func ListEdgeNodes ¶
@Summary list edge nodes @Description list edge nodes @Tags node @Accept json @Produce json @Param param body node.ListEdgeNodesReq true "userId:user id, userName: user name" @Success 200 {object} APISuccessResp{data=node.ListEdgeNodesRsp} "code:0, msg:OK" @Failure 400 {object} APIErrorResp "code:30000, msg:db error" @Router /listNode [post]
func NoReqSuccessResp ¶
func NodeHandlerRoutes ¶
func StartApiServer ¶
func StartApiServer(config *configs.EdgeCloudConfig) *http.Server
Start API server for portal
func SuccessResp ¶
////////////// Success Message //////////////////
func UploadNodeFile ¶
Types ¶
type APIErrorResp ¶
func ErrorNoBodyResp ¶
func ErrorNoBodyResp(code int, msg string) *APIErrorResp
func NoBodyUnAuthorizedError ¶
func NoBodyUnAuthorizedError(msg string) *APIErrorResp
func NoReqAppError ¶
func NoReqAppError(c *gin.Context, msg string) *APIErrorResp
func NotFoundError ¶
func NotFoundError(c *gin.Context, req *proto.Message) *APIErrorResp
func ParameterError ¶
func PreHandler ¶
func PreHandler(c *gin.Context, req *proto.Message, reqContent interface{}) (*proto.ApulisHeader, *APIErrorResp)
pre handler is used to handle the common logic of each comming request
func ServeError ¶
func ServerError ¶
func ServerError(c *gin.Context, req *proto.Message) *APIErrorResp
func UnAuthorizedError ¶
func UnknownError ¶
func (*APIErrorResp) Error ¶
func (e *APIErrorResp) Error() string
////////////// Error Message //////////////////