Merge Go frontend (apiserver + xcecli) into meson build

This commit is contained in:
Rongsong Shen 2026-04-14 11:20:17 +08:00
parent 43dc12a36c
commit c9dc8c4676
205 changed files with 30793 additions and 328 deletions

View file

@ -0,0 +1,61 @@
package common
const (
SUCCESS_MSG = "Success"
ERROR_MSG = "Fail"
INVALID_PARAMS_MSG = "Invalid parameters"
ERROR_AUTH_CHECK_TOKEN_MSG = "invalid token"
ERROR_AUTH_CHECK_TOKEN_EMPTY_MSG = "Authorization token is required"
ERROR_AUTH_TOKEN_TIMEOUT_MSG = "Token is expired"
ERROR_AUTH_MSG = "Authentication failed"
ERROR_NOT_FOUND_MSG = "resource not found"
ERROR_HOST_NOT_FOUND_MSG = "host not found"
ERROR_JOB_NOT_FOUND_MSG = "job not found"
ERROR_QUEUE_NOT_FOUND_MSG = "queue not found"
ERROR_JWT_GENERATION_MSG = "Failed to generate token"
ERROR_JWT_VALIDATION_MSG = "Failed to validate token"
ERROR_READ_REQUEST_BODY_MSG = "Request body invalid"
ERROR_REQUEST_BODY_EMPTY_MSG = "request body is empty"
ERROR_REQUEST_BODY_NOT_JSON_MSG = "request body is not json format"
ERROR_REQUEST_URL_NOT_FOUND = "request url is not found"
ERROR_GENERATE_JOBID_MSG = "Failed to generate job ID"
PARTIAL_DELETE_FILES_MSG = "Partially deleting files"
ERROR_CONNECT_BACKEND_MSG = "Failed to connect to backend"
ERROR_WRITE_DATA_MSG = "Failed to write data"
ERROR_QUERY_JOBINFO_MSG = "Failed to query job info"
ERROR_QUEUR_ROLEINFO_MSG = "Failed to query role info"
ERROR_QUERY_HOSTINFO_MSG = "Failed to query host info"
ERROR_QUERY_QUEUEINFO_MSG = "Failed to query queue info"
ERROR_QUERY_RESINFO_MSG = "Failed to query resource info"
ERROR_QUERY_CLUSTERINFO_MSG = "Failed to query cluster info"
ERROR_QUERY_PERMISSIONS_MSG = "Failed to query permissions"
ERROR_PARSE_JSON_STRING_MSG = "Failed to parse json string"
ERROR_INVALID_CLIENT_IP_MSG = "Invalid client IP"
ERROR_ACCESS_FORBIDDEN_MSG = "Access forbidden"
//read file error
ERROR_READ_FILE_MSG = "Failed to read file"
ERROR_PARSE_FILE_MSG = "Failed to parse file"
ERROR_FILTER_FORMAT_MSG = "Invalid filter format"
ERROR_TOO_MANY_REQUESTS_MSG = "Too many requests. Please try again later."
ERROR_GET_USERNAME_MSG = "Failed to get username from token"
ERROR_GET_USERPATH_MSG = "Failed to get user path"
ERROR_REMOVE_TOKEN_MSG = "Failed to remove token file"
)
const (
SUCCESS_CODE = 200
CREATED = 201
ACCEPTED = 202
StatusPartialContent = 206
ERROR_CODE = 500
INVALID_PARAMS_CODE = 400
ERROR_AUTH_CHECK_TOKEN_CODE = 401
ERROR_AUTH_CODE = 403
ERROR_NOT_FOUND_CODE = 404
ERROR_TOO_MANY_REQUESTS_CODE = 429
//read file error
ERROR_READ_FILE_CODE = 501
ERROR_PARSE_FILE_CODE = 502
)