redis/doctests
andy-stark-redis 80c9f5bb77
DOC-4345 added JSON samples for home page (#3183)
2024-11-06 17:25:46 +02:00
..
README.md Adds testable examples to be automatically pulled in redis.io docs (#2601) 2023-05-31 14:22:55 +01:00
bf_tutorial_test.go DOC-4237 added Bloom filter examples (#3115) 2024-09-26 10:41:54 +03:00
bitfield_tutorial_test.go DOC-4235 added bitfield examples (#3125) 2024-10-09 13:31:14 +03:00
bitmap_tutorial_test.go DOC-4234 added bitmap examples (#3124) 2024-09-25 21:03:54 +03:00
cmds_generic_test.go DOC-4328 added DEL, EXPIRE, and TTL command examples (#3143) 2024-10-09 13:44:29 +03:00
cmds_hash_test.go DOC-4322 added HSET/HGET command page examples (#3140) 2024-10-09 13:38:32 +03:00
cmds_sorted_set_test.go DOC-4324 added ZADD and ZRANGE command examples (#3142) 2024-10-09 13:42:24 +03:00
cmds_string_test.go DOC-4323 added INCR command example (#3141) 2024-10-09 13:40:21 +03:00
cms_tutorial_test.go DOC-4239 added Count-min sketch examples (#3118) 2024-10-09 13:24:47 +03:00
cuckoo_tutorial_test.go DOC-4238 added Cuckoo filter examples (#3116) 2024-10-09 08:56:44 +03:00
geo_tutorial_test.go DOC-4233 added geospatial examples (#3126) 2024-10-09 13:36:42 +03:00
hash_tutorial_test.go Doc 4226 hash tces (#3106) 2024-09-12 11:45:38 +03:00
hll_tutorial_test.go DOC-4236 added HyperLogLog examples (#3117) 2024-10-09 09:14:34 +03:00
home_json_example_test.go DOC-4345 added JSON samples for home page (#3183) 2024-11-06 17:25:46 +02:00
json_tutorial_test.go DOC-4228 JSON code examples (#3114) 2024-09-26 10:24:21 +03:00
list_tutorial_test.go DOC-4230 list doc code examples (#3110) 2024-09-12 13:54:42 +03:00
lpush_lrange_test.go Format code and fix go vet (#2696) 2023-09-20 14:03:44 +03:00
set_get_test.go Format code and fix go vet (#2696) 2023-09-20 14:03:44 +03:00
sets_example_test.go DOC-4231 added set datatype examples (#3111) 2024-09-12 14:16:15 +03:00
ss_tutorial_test.go DOC-4229 sorted set code examples (#3113) 2024-09-12 16:26:16 +03:00
stream_tutorial_test.go DOC-4232 stream code examples (#3128) 2024-10-23 17:47:25 +03:00
string_example_test.go DOC-4213 string code examples (#3102) 2024-09-06 14:49:25 +03:00
tdigest_tutorial_test.go DOC-4241 added t-digest examples (#3123) 2024-09-25 19:54:20 +03:00
topk_tutorial_test.go DOC-4240 added Top-K examples (#3119) 2024-10-09 13:33:46 +03:00

README.md

Command examples for redis.io

These examples appear on the Redis documentation site as part of the tabbed examples interface.

How to add examples

  • Create a Go test file with a meaningful name in the current folder.
  • Create a single method prefixed with Example and write your test in it.
  • Determine the id for the example you're creating and add it as the first line of the file: // EXAMPLE: set_and_get.
  • We're using the Testable Examples feature of Go to test the desired output has been written to stdout.

Special markup

See https://github.com/redis-stack/redis-stack-website#readme for more details.

How to test the examples

  • Start a Redis server locally on port 6379
  • CD into the doctests directory
  • Run go test to test all examples in the directory.
  • Run go test filename.go to test a single file