|
macro_rules! def_pub_const { |
|
($name:ident, $value:expr) => { |
|
pub const $name: &'static str = $value; |
|
}; |
|
} |
|
|
|
pub const COMMA: char = ','; |
|
|
|
def_pub_const!(PKG_VERSION, env!("CARGO_PKG_VERSION")); |
|
|
|
|
|
|
|
|
|
|
|
def_pub_const!(EMPTY_STRING, ""); |
|
|
|
def_pub_const!(COMMA_STRING, ","); |
|
|
|
def_pub_const!(ROUTE_ROOT_PATH, "/"); |
|
def_pub_const!(ROUTE_HEALTH_PATH, "/health"); |
|
def_pub_const!(ROUTE_GET_HASH, "/get-hash"); |
|
def_pub_const!(ROUTE_GET_CHECKSUM, "/get-checksum"); |
|
def_pub_const!(ROUTE_GET_TIMESTAMP_HEADER, "/get-tsheader"); |
|
def_pub_const!(ROUTE_USER_INFO_PATH, "/userinfo"); |
|
def_pub_const!(ROUTE_API_PATH, "/api"); |
|
def_pub_const!(ROUTE_LOGS_PATH, "/logs"); |
|
def_pub_const!(ROUTE_CONFIG_PATH, "/config"); |
|
def_pub_const!(ROUTE_TOKENS_PATH, "/tokens"); |
|
def_pub_const!(ROUTE_TOKENS_GET_PATH, "/tokens/get"); |
|
def_pub_const!(ROUTE_TOKENS_RELOAD_PATH, "/tokens/reload"); |
|
def_pub_const!(ROUTE_TOKENS_UPDATE_PATH, "/tokens/update"); |
|
def_pub_const!(ROUTE_TOKENS_ADD_PATH, "/tokens/add"); |
|
def_pub_const!(ROUTE_TOKENS_DELETE_PATH, "/tokens/delete"); |
|
def_pub_const!(ROUTE_ENV_EXAMPLE_PATH, "/env-example"); |
|
def_pub_const!(ROUTE_STATIC_PATH, "/static/{path}"); |
|
def_pub_const!(ROUTE_SHARED_STYLES_PATH, "/static/shared-styles.css"); |
|
def_pub_const!(ROUTE_SHARED_JS_PATH, "/static/shared.js"); |
|
def_pub_const!(ROUTE_ABOUT_PATH, "/about"); |
|
def_pub_const!(ROUTE_README_PATH, "/readme"); |
|
def_pub_const!(ROUTE_BASIC_CALIBRATION_PATH, "/basic-calibration"); |
|
def_pub_const!(ROUTE_BUILD_KEY_PATH, "/build-key"); |
|
|
|
def_pub_const!(DEFAULT_TOKEN_LIST_FILE_NAME, ".tokens"); |
|
|
|
def_pub_const!(STATUS_PENDING, "pending"); |
|
def_pub_const!(STATUS_SUCCESS, "success"); |
|
def_pub_const!(STATUS_FAILED, "failed"); |
|
|
|
def_pub_const!(HEADER_NAME_GHOST_MODE, "x-ghost-mode"); |
|
|
|
def_pub_const!(TRUE, "true"); |
|
def_pub_const!(FALSE, "false"); |
|
|
|
|
|
def_pub_const!(CONTENT_TYPE_CONNECT_PROTO, "application/connect+proto"); |
|
def_pub_const!(CONTENT_TYPE_TEXT_HTML_WITH_UTF8, "text/html;charset=utf-8"); |
|
def_pub_const!( |
|
CONTENT_TYPE_TEXT_PLAIN_WITH_UTF8, |
|
"text/plain;charset=utf-8" |
|
); |
|
def_pub_const!(CONTENT_TYPE_TEXT_CSS_WITH_UTF8, "text/css;charset=utf-8"); |
|
def_pub_const!( |
|
CONTENT_TYPE_TEXT_JS_WITH_UTF8, |
|
"text/javascript;charset=utf-8" |
|
); |
|
|
|
def_pub_const!(AUTHORIZATION_BEARER_PREFIX, "Bearer "); |
|
|
|
def_pub_const!(CURSOR_API2_HOST, "api2.cursor.sh"); |
|
def_pub_const!(CURSOR_HOST, "www.cursor.com"); |
|
def_pub_const!(CURSOR_SETTINGS_URL, "https://www.cursor.com/settings"); |
|
|
|
def_pub_const!(OBJECT_CHAT_COMPLETION, "chat.completion"); |
|
def_pub_const!(OBJECT_CHAT_COMPLETION_CHUNK, "chat.completion.chunk"); |
|
|
|
|
|
|
|
|
|
def_pub_const!(FINISH_REASON_STOP, "stop"); |
|
|
|
def_pub_const!(ERR_INVALID_PATH, "无效的路径"); |
|
|
|
|
|
|