Skip to content

Commit a3d89b2

Browse files
author
shumin
committed
add redis source docs
Signed-off-by: shumin <shumin@compubiq.com>
1 parent 6d261ee commit a3d89b2

3 files changed

Lines changed: 142 additions & 2 deletions

File tree

docs/reference/components/sinks/redis.cue

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ components: sinks: redis: {
2828
request: enabled: false
2929
tls: enabled: false
3030
to: {
31-
service: services.pulsar
32-
31+
service: services.redis
3332
interface: {
3433
socket: {
3534
direction: "outgoing"
@@ -99,4 +98,16 @@ components: sinks: redis: {
9998
logs: true
10099
metrics: null
101100
}
101+
102+
how_it_works: {
103+
redis_rs: {
104+
title: "redis-rs"
105+
body: """
106+
The `redis` sink uses [`redis-rs`](\(urls.redis_rs)) under the hood. This
107+
is a is a high level redis library for Rust. It provides convenient access to all Redis functionality through a very flexible but low-level API.
108+
It uses a customizable type conversion trait so that any operation can return results in just the type you are expecting.
109+
This makes for a very pleasant development experience.
110+
"""
111+
}
112+
}
102113
}
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
package metadata
2+
3+
components: sources: redis: {
4+
title: "Redis"
5+
description: "[Redis](\(urls.redis)) is an open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker."
6+
7+
features: {
8+
collect: {
9+
checkpoint: enabled: false
10+
tls: {
11+
enabled: true
12+
can_enable: true
13+
can_verify_certificate: false
14+
can_verify_hostname: false
15+
enabled_default: false
16+
}
17+
from: {
18+
service: services.redis
19+
interface: {
20+
socket: {
21+
direction: "incoming"
22+
port: 6379
23+
protocols: ["tcp"]
24+
ssl: "disabled"
25+
}
26+
}
27+
}
28+
}
29+
multiline: enabled: false
30+
}
31+
32+
classes: {
33+
commonly_used: false
34+
deployment_roles: ["aggregator"]
35+
delivery: "best_effort"
36+
development: "beta"
37+
egress_method: "stream"
38+
}
39+
40+
support: {
41+
targets: {
42+
"aarch64-unknown-linux-gnu": true
43+
"aarch64-unknown-linux-musl": true
44+
"x86_64-apple-darwin": true
45+
"x86_64-pc-windows-msv": true
46+
"x86_64-unknown-linux-gnu": true
47+
"x86_64-unknown-linux-musl": true
48+
}
49+
50+
requirements: []
51+
warnings: []
52+
notices: []
53+
}
54+
55+
installation: {
56+
platform_name: null
57+
}
58+
59+
configuration: {
60+
url: {
61+
description: "The Redis URL to connect to. The url _must_ take the form of `redis://server:port/db`."
62+
groups: ["tcp"]
63+
required: true
64+
warnings: []
65+
type: string: {
66+
examples: ["redis://127.0.0.1:6379/0"]
67+
}
68+
}
69+
key: {
70+
description: "The Redis key to read messages from."
71+
required: true
72+
warnings: []
73+
type: string: {
74+
examples: ["vector"]
75+
templateable: false
76+
}
77+
}
78+
data_type: {
79+
common: false
80+
description: "The Redis Data Type(list or channel) to use."
81+
required: false
82+
type: string: {
83+
default: "list"
84+
examples: ["list", "channel"]
85+
}
86+
}
87+
method: {
88+
common: false
89+
description: "The Method(brpop or blpop) to pop messages when data_type is list."
90+
required: false
91+
type: string: {
92+
default: "brpop"
93+
examples: ["brpop", "blpop"]
94+
}
95+
}
96+
redis_key: {
97+
common: false
98+
description: "The log field name to use for the redis key. If unspecified, the key would not be added to the log event."
99+
required: false
100+
warnings: []
101+
type: string: {
102+
default: null
103+
examples: ["redis_key"]
104+
}
105+
}
106+
}
107+
108+
output: logs: record: {
109+
description: "An individual Redis record"
110+
fields: {
111+
host: fields._local_host
112+
message: fields._raw_line
113+
timestamp: fields._current_timestamp
114+
}
115+
}
116+
117+
how_it_works: {
118+
redis_rs: {
119+
title: "redis-rs"
120+
body: """
121+
The `redis` source uses [`redis-rs`](\(urls.redis_rs)) under the hood. This
122+
is a is a high level redis library for Rust. It provides convenient access to all Redis functionality through a very flexible but low-level API.
123+
It uses a customizable type conversion trait so that any operation can return results in just the type you are expecting.
124+
This makes for a very pleasant development experience.
125+
"""
126+
}
127+
}
128+
}

docs/reference/urls.cue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,4 +459,5 @@ urls: {
459459
zlib: "https://www.zlib.net"
460460
zstd: "https://zstd.net"
461461
redis: "https://redis.io"
462+
redis_rs: "https://github.com/mitsuhiko/redis-rs"
462463
}

0 commit comments

Comments
 (0)