### Connect to Carade with redis-cli Source: https://codetease.gitbook.io/carade/getting-started This snippet demonstrates how to connect to a running Carade instance using the redis-cli tool. It specifies the port and includes an example of authenticating with the default password and executing basic SET and GET commands. ```bash # Connect to default port 63790 redis-cli -p 63790 # Authenticate (default password: teasertopsecret) 127.0.0.1:63790> AUTH teasertopsecret OK # Test command 127.0.0.1:63790> SET foo bar OK 127.0.0.1:63790> GET foo "bar" ``` -------------------------------- ### Build Carade from Source (Shell) Source: https://codetease.gitbook.io/carade/getting-started This sequence of shell commands clones the Carade repository from GitHub, navigates into the project directory, and builds the project using Maven. This method is recommended for development purposes. ```shell git clone https://github.com/codetease/carade.git cd carade mvn clean package ``` -------------------------------- ### Redis-like SET and GET Operations Source: https://codetease.gitbook.io/carade/getting-started Demonstrates how to set a value for a key and then retrieve it using a command-line interface. This is a fundamental operation for key-value stores. ```shell # Test command 127.0.0.1:63790> SET foo bar OK 127.0.0.1:63790> GET foo "bar" ``` -------------------------------- ### Example Request (SET command) Source: https://codetease.gitbook.io/carade/architecture/network-layer An example of a request using the SET command to store a key-value pair, formatted according to the RESP protocol. ```APIDOC ## Request Example: SET command ### Method POST ### Endpoint / ### Request Body ```resp *3\r\n$3\r\nSET\r\n$5\r\nmykey\r\n$7\r\nmyvalue\r\n ``` ### Response Example (Success) ```resp +OK\r\n ``` ``` -------------------------------- ### Run Carade Server (Shell) Source: https://codetease.gitbook.io/carade/getting-started This command executes the Carade server JAR file, which is typically generated after building the project from source. The server defaults to starting on port 63790. ```shell java -jar target/carade-0.3.4.jar ``` -------------------------------- ### Run Carade using Docker Source: https://codetease.gitbook.io/carade/getting-started This snippet shows how to pull the official Carade Docker image and run it as a detached container. It maps the default port and mounts a local directory for data persistence. Ensure Docker is installed and running. ```bash docker pull ghcr.io/codetease/carade:latest # Run with persistence mapped to local ./data directory docker run -d \ -p 63790:63790 \ -v $(pwd)/data:/data \ --name carade-server \ ghcr.io/codetease/carade:latest ``` -------------------------------- ### Pull CARADE LLM Docker Image Source: https://codetease.gitbook.io/carade/getting-started Pulls the latest CARADE LLM Docker image from the GitHub Container Registry. This is the first step before running the container. ```bash docker pull ghcr.io/codetease/carade:latest ``` -------------------------------- ### Redis LPUSH Command Example Source: https://codetease.gitbook.io/carade/architecture/network-layer This snippet demonstrates the usage of the Redis LPUSH command to add elements to the left side of a list. It's a basic example of interacting with Redis. ```redis LPUSH ``` -------------------------------- ### Carade Configuration (YAML) Source: https://context7_llms An example of Carade configuration using YAML format, covering network, security, memory, and persistence parameters. ```yaml network: port: 63790 bind: 0.0.0.0 security: requirepass: teasertopsecret users: default: teasertopsecret admin viewer: viewpass readonly writer: writepass readwrite memory: maxmemory: 256MB maxmemory-policy: noeviction persistence: appendonly: yes appendfilename: "carade.aof" save: - "900 1" - "300 10" ``` -------------------------------- ### Example RESP Array with SET Command Source: https://codetease.gitbook.io/carade/architecture/network-layer An example of a RESP array representing a 'SET' command with its key and value. This format is used for transmitting commands and their arguments in a structured manner. ```resp *3 $3 SET $5 mykey $7 myvalue ``` -------------------------------- ### Redis MASTERAUTH Command Example Source: https://codetease.gitbook.io/carade/architecture/replication This snippet shows the Redis MASTERAUTH command, used to authenticate a master server when replication is configured with a password. It requires the password to be provided as an argument. This is essential for secure replication setups. ```redis MASTERAUTH teasertopsecret ``` -------------------------------- ### Run Java JAR with Maven Source: https://codetease.gitbook.io/carade/getting-started This command executes a Java application packaged as a JAR file using Maven. It requires the 'mvn' command to be available in the system's PATH. The command takes the JAR file as an argument, typically located in the 'target' directory after a successful build. ```bash mvn -jar target/carade-0.3.4.jar ``` -------------------------------- ### Manage Carade Systemd Service Source: https://context7_llms These commands are used to manage the Carade systemd service. `daemon-reload` reloads systemd configurations, `enable` ensures the service starts on boot, and `start` initiates the service immediately. ```bash sudo systemctl daemon-reload sudo systemctl enable carade sudo systemctl start carade ``` -------------------------------- ### Redis SET Command Example Source: https://codetease.gitbook.io/carade/architecture/network-layer This snippet shows the Redis SET command, typically used to set a key-value pair in Redis. It's a fundamental operation for data storage. ```redis SET ``` -------------------------------- ### Run Chaos Tests with Python Source: https://context7_llms Simulate failure conditions using the Python chaos suite. This involves starting the Carade server and then running the chaos testing script. ```bash java -jar target/carade-0.3.4.jar & python3 tools/chaos/run_all.py ``` -------------------------------- ### Install Python Dependencies Source: https://codetease.gitbook.io/carade/development/testing This snippet shows how to install the required Python packages for the project. It assumes the existence of a 'requirements.txt' file in the 'tools/chaos' directory. If the file does not exist, standard Python libraries will be used. ```shell pip install -r tools/chaos/requirements.txt ``` -------------------------------- ### Docker Deployment for Carade Source: https://codetease.gitbook.io/carade/operations/deployment Instructions for deploying Carade using Docker. This method is recommended for its ease of use and scalability. It assumes Docker is installed and configured on the target system. ```bash # Example Docker deployment command (replace with actual image and configuration) docker run -d --name carade-instance -p 8080:8080 your-docker-repo/carade:latest # For data persistence, mount a volume: docker run -d --name carade-instance -p 8080:8080 -v /path/to/carade/data:/app/data your-docker-repo/carade:latest ``` -------------------------------- ### Carade Sample Configuration (Properties) Source: https://context7_llms A sample configuration file for Carade, demonstrating settings for network, security, memory management, and persistence. ```properties # Network port 63790 bind 0.0.0.0 # Security requirepass teasertopsecret # User ACL: user user default teasertopsecret admin user viewer viewpass readonly user writer writepass readwrite # Memory maxmemory 256MB maxmemory-policy noeviction # Persistence appendonly yes appendfilename "carade.aof" save 900 1 save 300 10 ``` -------------------------------- ### Check Java Version (Shell) Source: https://codetease.gitbook.io/carade/getting-started This command checks the installed Java version on the system. It is a prerequisite for running Carade, which requires Java 21 or later. The output typically includes the OpenJDK version number. ```shell java -version # Should output something like: openjdk version "21.0.1" ... ``` -------------------------------- ### Build and Run Rust Benchmark Client Source: https://context7_llms Compile and execute the high-performance Rust benchmark client. This tool measures latency, throughput, and connection handling against a running Carade server. ```bash cd tools/rust-benchmarks cargo build --release ./target/release/benchmark --host 127.0.0.1 --port 63790 --clients 50 --requests 100000 ``` -------------------------------- ### Configure Carade Replica to Connect to Master Source: https://context7_llms This configuration demonstrates how to set up a Carade replica to connect to a master server for replication. It includes the command to initiate replication and optional authentication settings. ```bash # Connect to master at 127.0.0.1:63790 REPLICAOF 127.0.0.1 63790 ``` ```properties replicaof 127.0.0.1 63790 masterauth teasertopsecret ``` -------------------------------- ### Detect Cloudflare Configuration Errors in JavaScript Source: https://codetease.gitbook.io/carade/getting-started This JavaScript code snippet runs on DOMContentLoaded to detect if the site is incorrectly configured with Cloudflare. If an issue is found, it appends an alert message to the body, guiding the user to GitBook's documentation for resolution. It relies on the presence of 'rocket-loader.min.js' in the document's scripts. ```javascript document.addEventListener("DOMContentLoaded", () => { if (Array.from(document.scripts).find(script => script.src.includes('rocket-loader.min.js'))) { const alert = document.createElement('div'); alert.className = 'p-4 mb-4 text-sm text-red-800 rounded-lg bg-red-50 mt-8 mx-8'; alert.innerHTML = ` Error in site configuration:< /strong> It looks like ${window.location.hostname} has been incorrectly configured in Cloudflare. This may lead to unexpected behavior or issues with the page loading. If you are the owner of this site, please refer to GitBook's documentation for steps to fix the problem. `; document.body.prepend(alert); } }); ``` -------------------------------- ### Run Carade with Docker and Custom Configuration Source: https://context7_llms This command launches the Carade Docker container, exposing port 63790, and mounts both a custom configuration file (`/opt/carade/carade.conf`) and a data volume (`/opt/carade/data`). This allows for custom settings and persistent data storage. ```bash docker run -d \ -p 63790:63790 \ -v /opt/carade/carade.conf:/app/carade.conf \ -v /opt/carade/data:/data \ ghcr.io/codetease/carade:latest ``` -------------------------------- ### Build Carade JAR using Maven Source: https://context7_llms This Maven command cleans the project, packages the application into a JAR file, and skips running tests. It's used for building the Carade application for bare metal deployment. ```bash mvn clean package -DskipTests ``` -------------------------------- ### Connect to CARADE LLM Redis Instance Source: https://codetease.gitbook.io/carade/getting-started Connects to the CARADE LLM's Redis instance running on the default port 63790 using redis-cli. It also includes the command to authenticate with the default password. ```bash # Connect to default port 63790 redis-cli -p 63790 # Authenticate (default password: teasertopsecret) 127.0.0.1:63790> AUTH teasertopsecret OK ``` -------------------------------- ### JVM Memory Settings for Carade Source: https://context7_llms This example demonstrates setting JVM memory arguments for running a Carade JAR. It specifies initial and maximum heap sizes of 4GB (`-Xms4G -Xmx4G`), suitable for a 4GB instance, and assumes `maxmemory` is set to 3GB in `carade.conf`. ```bash # carade.conf: maxmemory 3GB java -Xms4G -Xmx4G -jar carade.jar ``` -------------------------------- ### Run CARADE LLM Docker Container with Persistence Source: https://codetease.gitbook.io/carade/getting-started Runs the CARADE LLM Docker container in detached mode, mapping port 63790 and mounting a local './data' directory for persistence. The container is named 'carade-server'. ```bash docker run -d \ -p 63790:63790 \ -v $(pwd)/data:/data \ --name carade-server \ ghcr.io/codetease/carade:latest ``` -------------------------------- ### Initialize Admin Toolbar in JavaScript Source: https://codetease.gitbook.io/carade/getting-started This JavaScript code snippet is responsible for initializing the Admin Toolbar component within the application. It dynamically loads necessary JavaScript chunks and then registers the 'AdminToolbarClient'. This is crucial for enabling administrative functionalities on the site. ```javascript I([57902,["6268","static/chunks/f5718501-2b19465055d23f42.js?dpl=59ffb95417795c0d96c480da62fd9440881efa4b","6500","static/chunks/6500-67bcd052acfdf034.js?dpl=59ffb95417795c0d96c480da62fd9440881efa4b","4945","static/chunks/4945-430fa5cc2f8244f6.js?dpl=59ffb95417795c0d96c480da62fd9440881efa4b","9014","static/chunks/9014-9e9ac151fee1dff7.js?dpl=59ffb95417795c0d96c480da62fd9440881efa4b","9259","static/chunks/9259-7e5bb23ceee715bb.js?dpl=59ffb95417795c0d96c480da62fd9440881efa4b","3","static/chunks/3-d7ced05f08ff3468.js?dpl=59ffb95417795c0d96c480da62fd9440881efa4b","559","static/chunks/app/sites/static/%5Bmode%5D/%5BsiteURL%5D/%5BsiteData%5D/(content)/layout-2ca23bbf3e53ebff.js?dpl=59ffb95417795c0d96c480da62fd9440881efa4b"],"AdminToolbarClient") ``` -------------------------------- ### Define OS-Specific Classes with JavaScript Source: https://codetease.gitbook.io/carade/getting-started This JavaScript code detects the user's operating system (specifically checking for macOS) and adds or removes the 'os-mac' class to the document's root element accordingly. This allows for OS-specific styling. ```javascript (function f3() { if (typeof navigator > "u") return; let a3 = "os-mac", b4 = navigator.platform.toLowerCase().includes("mac"), c3 = document.documentElement; b4 ? c3.classList.add(a3) : c3.classList.remove(a3); })() ``` -------------------------------- ### Redis BLPOP Command Example Source: https://codetease.gitbook.io/carade/commands/lists Demonstrates the usage of the BLPOP command in Redis, which removes and retrieves the first element from a list. It can block until an element is available if the list is empty. This is a common operation for message queues and producer-consumer patterns. ```redis BLPOP key timeout ``` -------------------------------- ### Initialize Side Sheet Component in JavaScript Source: https://codetease.gitbook.io/carade/getting-started This JavaScript code snippet is responsible for initializing the Side Sheet component. It loads the necessary JavaScript modules and then registers the 'SideSheet' component, likely for use in displaying side panels or drawers within the application's UI. ```javascript I([52047,["6268","static/chunks/f5718501-2b19465055d23f42.js?dpl=59ffb95417795c0d96c480da62fd9440881efa4b","6500","static/chunks/6500-67bcd052acfdf034.js?dpl=59ffb95417795c0d96c480da62fd9440881efa4b","4945","static/chunks/4945-430fa5cc2f8244f6.js?dpl=59ffb95417795c0d96c480da62fd9440881efa4b","9014","static/chunks/9014-9e9ac151fee1dff7.js?dpl=59ffb95417795c0d96c480da62fd9440881efa4b","9259","static/chunks/9259-7e5bb23ceee715bb.js?dpl=59ffb95417795c0d96c480da62fd9440881efa4b","3","static/chunks/3-d7ced05f08ff3468.js?dpl=59ffb95417795c0d96c480da62fd9440881efa4b","559","static/chunks/app/sites/static/%5Bmode%5D/%5BsiteURL%5D/%5BsiteData%5D/(content)/layout-2ca23bbf3e53ebff.js?dpl=59ffb95417795c0d96c480da62fd9440881efa4b"],"SideSheet") ``` -------------------------------- ### CSS Variables for Theme Colors Source: https://codetease.gitbook.io/carade/getting-started This CSS defines a comprehensive set of color variables for various themes and states, including primary, tint, neutral, header, info, warning, danger, and success colors. These variables are used to style the application's appearance and can be toggled for different color schemes. ```css :root, .light, .dark [data-color-scheme$="light"], .dark [data-follow-color-scheme="true"]:has([data-color-scheme$="light"]) { --primary-1: 255 255 255; --contrast-primary-1: 29 29 29; --primary-2: 247 250 255; --contrast-primary-2: 29 29 29; --primary-3: 241 248 255; --contrast-primary-3: 29 29 29; --primary-4: 233 243 255; --contrast-primary-4: 29 29 29; --primary-5: 224 238 255; --contrast-primary-5: 29 29 29; --primary-6: 213 230 255; --contrast-primary-6: 29 29 29; --primary-7: 198 218 253; --contrast-primary-7: 29 29 29; --primary-8: 182 205 246; --contrast-primary-8: 29 29 29; --primary-9: 52 109 219; --contrast-primary-9: 255 255 255; --primary-10: 57 115 225; --contrast-primary-10: 255 255 255; --primary-11: 87 110 152; --contrast-primary-11: 255 255 255; --primary-12: 24 29 38; --contrast-primary-12: 255 255 255; --primary-original: 52 109 219; --contrast-primary-original: 255 255 255; --tint-1: 255 255 255; --contrast-tint-1: 29 29 29; --tint-2: 249 250 251; --contrast-tint-2: 29 29 29; --tint-3: 246 247 250; --contrast-tint-3: 29 29 29; --tint-4: 240 242 246; --contrast-tint-4: 29 29 29; --tint-5: 234 237 242; --contrast-tint-5: 29 29 29; --tint-6: 226 230 236; --contrast-tint-6: 29 29 29; --tint-7: 213 217 224; --contrast-tint-7: 29 29 29; --tint-8: 200 205 213; --contrast-tint-8: 29 29 29; --tint-9: 121 133 155; --contrast-tint-9: 255 255 255; --tint-10: 110 122 143; --contrast-tint-10: 255 255 255; --tint-11: 106 110 119; --contrast-tint-11: 255 255 255; --tint-12: 28 29 31; --contrast-tint-12: 255 255 255; --tint-original: 120 120 120; --contrast-tint-original: 255 255 255; --neutral-1: 255 255 255; --contrast-neutral-1: 29 29 29; --neutral-2: 250 250 250; --contrast-neutral-2: 29 29 29; --neutral-3: 247 247 247; --contrast-neutral-3: 29 29 29; --neutral-4: 242 242 242; --contrast-neutral-4: 29 29 29; --neutral-5: 237 237 237; --contrast-neutral-5: 29 29 29; --neutral-6: 229 229 229; --contrast-neutral-6: 29 29 29; --neutral-7: 217 217 217; --contrast-neutral-7: 29 29 29; --neutral-8: 204 204 204; --contrast-neutral-8: 29 29 29; --neutral-9: 120 120 120; --contrast-neutral-9: 255 255 255; --neutral-10: 121 121 121; --contrast-neutral-10: 255 255 255; --neutral-11: 110 110 110; --contrast-neutral-11: 255 255 255; --neutral-12: 29 29 29; --contrast-neutral-12: 255 255 255; --neutral-original: 120 120 120; --contrast-neutral-original: 255 255 255; --header-background: 52 109 219; --header-link: 255 255 255; --info-1: 255 255 255; --contrast-info-1: 29 29 29; --info-2: 250 250 250; --contrast-info-2: 29 29 29; --info-3: 247 247 247; --contrast-info-3: 29 29 29; --info-4: 242 242 242; --contrast-info-4: 29 29 29; --info-5: 237 237 237; --contrast-info-5: 29 29 29; --info-6: 229 229 229; --contrast-info-6: 29 29 29; --info-7: 217 217 217; --contrast-info-7: 29 29 29; --info-8: 204 204 204; --contrast-info-8: 29 29 29; --info-9: 120 120 120; --contrast-info-9: 255 255 255; --info-10: 121 121 121; --contrast-info-10: 255 255 255; --info-11: 110 110 110; --contrast-info-11: 255 255 255; --info-12: 29 29 29; --contrast-info-12: 255 255 255; --info-original: 120 120 120; --contrast-info-original: 255 255 255; --warning-1: 255 255 255; --contrast-warning-1: 29 29 29; --warning-2: 254 249 244; --contrast-warning-2: 29 29 29; --warning-3: 255 245 236; --contrast-warning-3: 29 29 29; --warning-4: 255 239 225; --contrast-warning-4: 29 29 29; --warning-5: 254 233 214; --contrast-warning-5: 29 29 29; --warning-6: 250 224 200; --contrast-warning-6: 29 29 29; --warning-7: 242 211 182; --contrast-warning-7: 29 29 29; --warning-8: 233 197 164; --contrast-warning-8: 29 29 29; --warning-9: 254 154 0; --contrast-warning-9: 29 29 29; --warning-10: 187 92 0; --contrast-warning-10: 255 255 255; --warning-11: 138 102 66; --contrast-warning-11: 255 255 255; --warning-12: 35 28 21; --contrast-warning-12: 255 255 255; --warning-original: 254 154 0; --contrast-warning-original: 29 29 29; --danger-1: 255 255 255; --contrast-danger-1: 29 29 29; --danger-2: 255 247 246; --contrast-danger-2: 29 29 29; --danger-3: 255 242 239; --contrast-danger-3: 29 29 29; --danger-4: 255 234 230; --contrast-danger-4: 29 29 29; --danger-5: 255 226 221; --contrast-danger-5: 29 29 29; --danger-6: 255 215 210; --contrast-danger-6: 29 29 29; --danger-7: 255 200 193; --contrast-danger-7: 29 29 29; --danger-8: 254 184 177; --contrast-danger-8: 29 29 29; --danger-9: 251 44 54; --contrast-danger-9: 255 255 255; --danger-10: 228 0 33; --contrast-danger-10: 255 255 255; --danger-11: 158 87 81; --contrast-danger-11: 255 255 255; --danger-12: 39 25 23; --contrast-danger-12: 255 255 255; --danger-original: 251 44 54; --contrast-danger-original: 255 255 255; --success-1: 255 255 255; --contrast-succe ``` -------------------------------- ### Clean and Package Project with Maven Source: https://codetease.gitbook.io/carade/getting-started These Maven commands are used to manage the project lifecycle. 'mvn clean' removes previously compiled files and build artifacts, ensuring a fresh build. 'mvn package' compiles the source code, runs tests, and packages the application into a JAR file, typically located in the 'target' directory. ```bash mvn clean package ``` -------------------------------- ### Netty Worker Threads Configuration (System Property) Source: https://context7_llms This example shows how to configure the number of worker threads for Netty, the I/O framework used by Carade. Setting the `io.netty.eventLoopThreads` system property to `8` allows for customization beyond the default, potentially improving I/O performance. ```bash -Dio.netty.eventLoopThreads=8 ``` -------------------------------- ### CSS Color Variables Definition Source: https://codetease.gitbook.io/carade/getting-started This CSS code defines a wide range of color variables used for theming. It includes variables for primary, success, info, warning, and danger color palettes, each with multiple shades and corresponding contrast colors. These variables are designed to be used across different color schemes, including light and dark modes. ```css .light, :root:not(.dark) { --success-1: 29 29 29; --contrast-success-1: 255 255 255; --success-2: 245 252 246; --contrast-success-2: 29 29 29; --success-3: 238 252 240; --contrast-success-3: 29 29 29; --success-4: 229 249 231; --contrast-success-4: 29 29 29; --success-5: 219 246 222; --contrast-success-5: 29 29 29; --success-6: 207 240 210; --contrast-success-6: 29 29 29; --success-7: 190 229 194; --contrast-success-7: 29 29 29; --success-8: 172 218 177; --contrast-success-8: 29 29 29; --success-9: 0 201 80; --contrast-success-9: 29 29 29; --success-10: 0 152 23; --contrast-success-10: 255 255 255; --success-11: 74 124 82; --contrast-success-11: 255 255 255; --success-12: 22 32 23; --contrast-success-12: 255 255 255; --success-original: 0 201 80; --contrast-success-original: 29 29 29; } .dark, :root:not(.dark) [data-color-scheme^="dark"], :root:not(.dark) [data-follow-color-scheme="true"] :has([data-color-scheme^="dark"]) { --primary-1: 29 29 29; --contrast-primary-1: 255 255 255; --primary-2: 32 35 39; --contrast-primary-2: 255 255 255; --primary-3: 39 44 53; --contrast-primary-3: 255 255 255; --primary-4: 40 48 62; --contrast-primary-4: 255 255 255; --primary-5: 43 54 72; --contrast-primary-5: 255 255 255; --primary-6: 45 58 81; --contrast-primary-6: 255 255 255; --primary-7: 52 68 96; --contrast-primary-7: 255 255 255; --primary-8: 59 78 112; --contrast-primary-8: 255 255 255; --primary-9: 52 109 219; --contrast-primary-9: 255 255 255; --primary-10: 80 139 252; --contrast-primary-10: 255 255 255; --primary-11: 167 193 239; --contrast-primary-11: 29 29 29; --primary-12: 249 255 255; --contrast-primary-12: 29 29 29; --primary-original: 52 109 219; --contrast-primary-original: 255 255 255; --tint-1: 29 29 29; --contrast-tint-1: 255 255 255; --tint-2: 34 34 35; --contrast-tint-2: 255 255 255; --tint-3: 43 44 45; --contrast-tint-3: 255 255 255; --tint-4: 47 48 49; --contrast-tint-4: 255 255 255; --tint-5: 52 54 55; --contrast-tint-5: 255 255 255; --tint-6: 56 58 60; --contrast-tint-6: 255 255 255; --tint-7: 66 68 70; --contrast-tint-7: 255 255 255; --tint-8: 76 78 81; --contrast-tint-8: 255 255 255; --tint-9: 127 133 144; --contrast-tint-9: 255 255 255; --tint-10: 138 145 156; --contrast-tint-10: 255 255 255; --tint-11: 190 192 197; --contrast-tint-11: 29 29 29; --tint-12: 254 255 255; --contrast-tint-12: 29 29 29; --tint-original: 120 120 120; --contrast-tint-original: 255 255 255; --neutral-1: 29 29 29; --contrast-neutral-1: 255 255 255; --neutral-2: 34 34 34; --contrast-neutral-2: 255 255 255; --neutral-3: 44 44 44; --contrast-neutral-3: 255 255 255; --neutral-4: 48 48 48; --contrast-neutral-4: 255 255 255; --neutral-5: 53 53 53; --contrast-neutral-5: 255 255 255; --neutral-6: 57 57 57; --contrast-neutral-6: 255 255 255; --neutral-7: 67 67 67; --contrast-neutral-7: 255 255 255; --neutral-8: 78 78 78; --contrast-neutral-8: 255 255 255; --neutral-9: 120 120 120; --contrast-neutral-9: 255 255 255; --neutral-10: 144 144 144; --contrast-neutral-10: 255 255 255; --neutral-11: 192 192 192; --contrast-neutral-11: 29 29 29; --neutral-12: 255 255 255; --contrast-neutral-12: 29 29 29; --neutral-original: 120 120 120; --contrast-neutral-original: 255 255 255; --header-background: 52 109 219; --header-link: 255 255 255; --info-1: 29 29 29; --contrast-info-1: 255 255 255; --info-2: 34 34 34; --contrast-info-2: 255 255 255; --info-3: 44 44 44; --contrast-info-3: 255 255 255; --info-4: 48 48 48; --contrast-info-4: 255 255 255; --info-5: 53 53 53; --contrast-info-5: 255 255 255; --info-6: 57 57 57; --contrast-info-6: 255 255 255; --info-7: 67 67 67; --contrast-info-7: 255 255 255; --info-8: 78 78 78; --contrast-info-8: 255 255 255; --info-9: 120 120 120; --contrast-info-9: 255 255 255; --info-10: 144 144 144; --contrast-info-10: 255 255 255; --info-11: 192 192 192; --contrast-info-11: 29 29 29; --info-12: 255 255 255; --contrast-info-12: 29 29 29; --info-original: 120 120 120; --contrast-info-original: 255 255 255; --warning-1: 29 29 29; --contrast-warning-1: 255 255 255; --warning-2: 38 34 30; --contrast-warning-2: 255 255 255; --warning-3: 50 42 35; --contrast-warning-3: 255 255 255; --warning-4: 57 45 34; --contrast-warning-4: 255 255 255; --warning-5: 66 50 34; --contrast-warning-5: 255 255 255; --warning-6: 73 53 33; --contrast-warning-6: 255 255 255; --warning-7: 87 62 37; --contrast-warning-7: 255 255 255; --warning-8: 101 71 41; --contrast-warning-8: 255 255 255; --warning-9: 254 154 0; --contrast-warning-9: 29 29 29; --warning-10: 213 116 0; --contrast-warning-10: 255 255 255; --warning-11: 224 184 145; --contrast-warning-11: 29 29 29; --warning-12: 255 253 243; --contrast-warning-12: 29 29 29; --warning-original: 254 154 0; --contrast-warning-original: 29 29 29; --danger-1: 29 29 29; --contrast-danger-1: 255 255 255; --danger-2: 40 32 32; --contrast-danger-2: 255 255 255; --danger-3: 55 39 38; --contrast-danger-3: 255 255 255; --danger-4: 64 41 38; --contrast-danger-4: 255 255 255; --danger-5: 75 44 41; --contrast-danger-5: 255 255 255; --danger-6: 84 45 41; --contrast-danger-6: 255 255 255; } ``` -------------------------------- ### Get String Value (GET) Source: https://codetease.gitbook.io/carade/commands/strings Retrieves the string value associated with a given key. This is a fundamental operation for accessing stored data. ```redis GET key ``` -------------------------------- ### Local Command Execution Explanation Source: https://codetease.gitbook.io/carade/architecture/replication This snippet explains that Replica executes commands locally. It's a simple text description without specific code implementation. ```text Replica executes these commands locally. ``` -------------------------------- ### String Operations (Redis) Source: https://context7_llms String keys can store binary safe data up to 512MB. Carade supports standard Redis String commands including setting values (SET), getting values (GET), incrementing/decrementing integers (INCR, DECR), appending to strings (APPEND), and getting string length (STRLEN). ```redis SET mykey "Hello World" GET mykey INCR mycounter DECR mycounter APPEND mykey " More text" STRLEN mykey ``` -------------------------------- ### Connection Management Source: https://codetease.gitbook.io/carade/architecture/network-layer Details on how Carade manages client connections, including tracking active clients, resource cleanup upon disconnection, and handling blocking operations like BLPOP. ```APIDOC ## Connection Management * **Active Connections:** Tracked via `Carade.connectedClients`. * **Cleanup:** When a client disconnects, `ClientHandler.channelInactive()` ensures resources (blocking requests, watchers) are cleaned up. * **Blocking Operations:** Handled via `Carade.blockingRegistry`. When a client calls `BLPOP`, the request is stored in a queue. When data arrives (via `LPUSH`), the blocking client is notified and the response is sent asynchronously. ``` -------------------------------- ### Get Set Cardinality (SCARD) Source: https://codetease.gitbook.io/carade/commands/sets Returns the number of members in a specified set. This command is efficient for quickly getting the size of a set without retrieving all its elements. ```redis SCARD key ``` -------------------------------- ### Scripting Commands Source: https://context7_llms Carade allows for server-side scripting using Lua with commands like EVAL and SCRIPT. ```APIDOC ## Scripting Commands * `EVAL`, `EVALSHA`, `EVAL_RO`, `EVALSHA_RO`, `SCRIPT ``` -------------------------------- ### Full List of Sorted Set Commands Source: https://codetease.gitbook.io/carade/commands/sorted-sets Access the complete documentation for all Redis Sorted Set commands. ```APIDOC ## Full List of Sorted Set Commands ### Description See the full list of available Redis Sorted Set commands for comprehensive details on their usage and parameters. ### Endpoint /redis/sorted-sets/all ### Response #### Success Response (200) - **documentation_url** (string) - A URL pointing to the complete documentation. #### Response Example ```json { "documentation_url": "https://redis.io/commands/" } ``` ``` -------------------------------- ### ZCARD Source: https://codetease.gitbook.io/carade/commands/sorted-sets Get the number of members in a sorted set. ```APIDOC ## ZCARD key ### Description Get the number of members in a sorted set. ### Method GET ### Endpoint /redis/sorted-sets/card ### Parameters #### Query Parameters - **key** (string) - Required - The key of the sorted set. ### Request Example ```json { "key": "mySortedSet" } ``` ### Response #### Success Response (200) - **count** (integer) - The number of members in the sorted set. #### Response Example ```json { "count": 2 } ``` ```