Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ target/
# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb
dumb.rdb
.superpowers/
.worktrees/
.bundle/
_site/
vendor/bundle/
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Build Your Own Redis in Rust

Project site: [https://fangpin.github.io/redis-rs/](https://fangpin.github.io/redis-rs/)
Docs overview: [https://fangpin.github.io/redis-rs/docs/overview/](https://fangpin.github.io/redis-rs/docs/overview/)

This project is to build a toy Redis-Server clone that's capable of parsing Redis protocol and handling basic Redis commands, parsing and initializing Redis from RDB file,
supporting leader-follower replication, redis streams (queue), redis batch commands in transaction.

Expand Down
5 changes: 4 additions & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# 使用 Rust 构建你自己的 Redis

项目主页: [https://fangpin.github.io/redis-rs/](https://fangpin.github.io/redis-rs/)
文档总览: [https://fangpin.github.io/redis-rs/zh/docs/overview/](https://fangpin.github.io/redis-rs/zh/docs/overview/)

该项目旨在构建一个玩具 Redis-Server,它能够解析 Redis 协议并处理基本的 Redis 命令; 将 Redis 持久化化到 RDB 文件中;从 RDB 文件解析和初始化 Redis,
支持主从复制、Redis 流。

Expand Down Expand Up @@ -237,4 +240,4 @@ Redis 流用例的示例包括:
- 通知(例如,将每个用户的通知记录存储在单独的流中)


-- 未完待续
-- 未完待续
8 changes: 6 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
title: 从 0 到 1 由 Rust 构建 Redis
description: 从 0 到 1 由 Rust 构建 Redis
theme: just-the-docs
color_scheme: redis-rs

url: https://fangpin.github.io/redis-rs
url: https://fangpin.github.io

aux_links:
GitHub: https://fangpin.github.io/redis-rs
GitHub: https://github.com/fangpin/redis-rs

exclude:
- docs/superpowers/

# logo: "/assets/images/just-the-docs.png"

Expand Down
23 changes: 23 additions & 0 deletions _sass/color_schemes/redis-rs.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
$color-scheme: dark;

$body-background-color: #07111f;
$body-heading-color: #ecf7ff;
$body-text-color: rgba(#ecf7ff, 0.82);
$link-color: #79f0ff;
$nav-child-link-color: rgba(#ecf7ff, 0.68);
$sidebar-color: #081524;
$base-button-color: #0d2033;
$btn-primary-color: #79f0ff;
$code-background-color: #0b1829;
$code-linenumber-color: #9ecfe4;
$feedback-color: #10263b;
$table-background-color: #0a1626;
$search-background-color: #081524;
$search-result-preview-color: rgba(#ecf7ff, 0.62);
$border-color: rgba(#79f0ff, 0.22);

$redis-panel-background: rgba(#081524, 0.88);
$redis-panel-background-strong: rgba(#0a1626, 0.94);
$redis-accent-strong: #9dffb8;

@import "./vendor/OneDarkJekyll/syntax";
174 changes: 174 additions & 0 deletions _sass/custom/custom.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
body {
background:
radial-gradient(circle at top left, rgba($link-color, 0.18), transparent 28%),
radial-gradient(circle at 85% 10%, rgba($redis-accent-strong, 0.12), transparent 18%),
linear-gradient(180deg, #050b14, #091426 45%, $body-background-color 100%);
}

body::before {
content: "";
position: fixed;
inset: 0;
pointer-events: none;
background-image:
linear-gradient(rgba($link-color, 0.06) 1px, transparent 1px),
linear-gradient(90deg, rgba($link-color, 0.05) 1px, transparent 1px);
background-size: 72px 72px;
mask-image: linear-gradient(180deg, rgba(#fff, 0.45), transparent 82%);
}

.side-bar {
background: $redis-panel-background;
backdrop-filter: blur(18px);

@include mq(md) {
box-shadow: 18px 0 48px rgba(0, 0, 0, 0.26);
}
}

.site-header,
.main-header {
backdrop-filter: blur(18px);
}

.site-header {
background: rgba($body-background-color, 0.82);
}

.side-bar + .main .main-header {
background: $redis-panel-background-strong;
}

.search-input-wrap,
.search-results,
.table-wrapper,
.main-content blockquote,
pre.highlight,
.highlight pre {
border: 1px solid $border-color;
background: $redis-panel-background-strong;
box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.search-input-wrap {
border-radius: 12px;

@include mq(md) {
border-radius: 0;
border-left: 1px solid $border-color;
}
}

.search-input,
.search-results,
.search-result,
.search-result-previews {
background-color: transparent;
}

.search-input {
color: $body-text-color;

&::placeholder {
color: rgba($body-text-color, 0.6);
}
}

.search-label .search-icon {
color: rgba($body-text-color, 0.62);
}

.search-result:hover,
.search-result.active {
background-color: rgba($link-color, 0.12);
}

.site-title,
.nav-list .nav-list-item .nav-list-link,
.nav-list .nav-list-item .nav-list-expander,
.aux-nav .site-button {
color: $body-heading-color;
}

.nav-list .nav-list-item .nav-list-link {
color: rgba($body-heading-color, 0.74);
transition: background 180ms ease, color 180ms ease;
}

.nav-list .nav-list-item .nav-list-link:hover,
.nav-list .nav-list-item .nav-list-link.active,
.site-title:hover,
.site-button:hover {
background-image: linear-gradient(
-90deg,
rgba($link-color, 0.16) 0%,
rgba($link-color, 0.08) 80%,
rgba($link-color, 0) 100%
);
}

.nav-list .nav-list-item > .nav-list .nav-list-item .nav-list-link,
.nav-list .nav-list-item > .nav-list .nav-list-item .nav-list-expander {
color: $nav-child-link-color;
}

.site-button {
color: $link-color;
}

.main-content {
h1,
h2,
h3,
h4,
h5,
h6 {
color: $body-heading-color;
}

h2,
h3 {
padding-top: 0.9rem;
border-top: 1px solid rgba($border-color, 0.65);
}

a:not([class]) {
text-decoration-color: rgba($link-color, 0.45);
}

code {
color: $redis-accent-strong;
}

ul > li::before,
ol > li::before {
color: rgba($link-color, 0.75);
}

blockquote {
padding: 1rem 1.25rem;
border-left-color: rgba($link-color, 0.7);
border-radius: 0 12px 12px 0;
}
}

thead th {
background: rgba($link-color, 0.08);
}

tbody tr:nth-child(2n) td {
background: rgba($white, 0.02);
}

th,
td {
border-color: rgba($border-color, 0.9);
}

hr {
background-color: $border-color;
}

.site-footer {
color: rgba($body-text-color, 0.65);
}
3 changes: 3 additions & 0 deletions _sass/custom/setup.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$redis-panel-background: rgba(#081524, 0.88) !default;
$redis-panel-background-strong: rgba(#0a1626, 0.94) !default;
$redis-accent-strong: #9dffb8 !default;
Loading
Loading